1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| #!/usr/bin/perl
use strict;
use Encode;
use LWP::Simple;
use XML::RSS;
use HTML::Parser;
#script to : downlaod and store HTML files from the irish independent RSS feed.
my @RSS_URLs = ("http://rss.independent.ie/c/32444/f/474631/index.rss");
#binmode (STDOUT);
binmode (STDOUT, ":encoding(utf8)");
for my $url (@RSS_URLs) {
my $document = LWP::Simple::get($url) or die "cannot get content from $url";
my $rss = XML::RSS->new;
$rss->parse($document);
#$i=1;
for (@{$rss->{items}}) {
my $results=$_->{guid};
my $title = $_->{title};
my $rss_htmls=(`wget $results`);
#my $rss_htmls=(`wget -o \"".$title."\".html`.$results);
#$rss_htmls = system("wget -o \"".$")
print $rss_htmls;
}
} |
Partager