#!/usr/bin/perl
## Saves RSS feeds as feed.0, feed.1, feed.2, etc...
## I couldn't really come up with a way to name the files more descriptively
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');
## Put feeds here
@feeds = ("http://linuxgazette.net/lg.atom.xml",
"http://www.fark.com/fark.rss",
"http://rss.slashdot.org/Slashdot/slashdot");
for( $i=0; $i<@feeds; $i++){
my $response = $ua->get("$feeds[$i]");
if ($response->is_success) {
open(OUT, ">>feed.$i") ;
print OUT $response->content;
}
else {
die $response->status_line;
}
}