#!/usr/bin/perl #use strict; $| = 1; use Storable qw(nstore retrieve); use XML::FeedPP; use Date::Manip; use LWP::UserAgent; Date_Init("TZ=MST"); my $feeddate = UnixDate("now","%a, %e %b %Y %H:%M:%S %z"); my @feeds = qw ( http://fox-obfeeds.endplay.com/feeds/rssFeed?obfType=RSS_FEED&siteId=200017 http://www.kpho.com/category/216452/kpho-newstream?clienttype=rss http://www.kpho.com/category/210050/5-investigates?clienttype=rss http://scrippsobfeeds.endplay.com/content-syndication-portlet/feedServlet?obfType=RSS_FEED&siteId=10008&categoryId=20413 http://scrippsobfeeds.endplay.com/content-syndication-portlet/feedServlet?obfType=RSS_FEED&siteId=10008&categoryId=20423 http://scrippsobfeeds.endplay.com/content-syndication-portlet/feedServlet?obfType=RSS_FEED&siteId=10008&categoryId=10001 http://scrippsobfeeds.endplay.com/content-syndication-portlet/feedServlet?obfType=RSS_FEED&siteId=10008&categoryId=20412 http://scrippsobfeeds.endplay.com/content-syndication-portlet/feedServlet?obfType=RSS_FEED&siteId=10008&categoryId=20001 http://www.phoenixnewtimes.com/index.rss ); my $dryheat = XML::FeedPP::RSS->new(); $dryheat->title("Dryheat Phoenix News"); $dryheat->description("Aggregated News from Various Phoenix Sources"); $dryheat->pubDate($feeddate); my $ua = LWP::UserAgent->new(); my $ctr = 0; print "Getting feeds.\n"; foreach my $f (@feeds) { $ctr++; my $response = $ua->get($f); if ($response->is_success) { my $feed; eval {$feed = XML::FeedPP->new($response->content, -type => 'string'); }; if ($feed) { $dryheat->merge($feed); } print "\tOK $f\n"; } else { print "\tResponse failed: $f ",$response->status_line,"\n"; } } $dryheat->normalize(); open(OUT,">dryheat-rss.htm") or die "Can't open output: $!"; print OUT '
',join(" - ",@header),"
\n"; print OUT "\n"; print OUT "$description