1

This is a snippet of config file of snownews (a terminal based news aggregator).

Problem: When I try to view a rss feed on terminal, I can only view text till the image! after that everything is blank. Also since i'm using a terminal image is also not supported.

image: https://i.stack.imgur.com/D1Adt.jpg

Here is the code were the web scraping takes place. I only need to view text without any images.

    # Importing
    if (($PROGRAM_NAME =~ "snow2opml") || ($ARGV[0] eq "--export")) {
            OPMLexport();
    } else {
            my $parser = XML::LibXML->new();
            $parser->validation(0);                         # Turn off validation from libxml
            $parser->recover(1);                            # And ignore any errors while parsi>
    
            my(@lines) = <>;
            my($input) = join ("\n", @lines);
    
            my($doc) = $parser->parse_string($input);
            my($root) = $doc->documentElement();
    
            # Parsing the document tree using xpath
            my(@items) = $root->findnodes("//outline");
            foreach (@items) {
                    my(@attrs) = $_->attributes();
                    foreach (@attrs) {
                            # Only print attribute xmlUrl=""
                            if ($_->nodeName =~ /xmlUrl/i) {
                                    print $_->value."\n";
                            }
                    }
            }
    }

If the full code is needed I can post it

Michał Politowski
  • 4,288
  • 3
  • 30
  • 41
rootskull
  • 11
  • 1

0 Answers0