in reply to Accessing RSS feeds using perl
Hi,
For example:
#!/usr/bin/perl use warnings; use strict; use XML::RSS; use LWP::Simple; # Get the source file my $source = get("http://www.traffic.com/feeds/rss_atlanta.xml"); # Create a new XML:RSS object my $rss = new XML::RSS (version => '2.0'); # Parse the file into the XML::RSS object $rss->parse($source); # For example print titles and links of each RSS item foreach my $item (@{$rss->{'items'}}) { print "title: $item->{'title'}\n"; print "link: $item->{'link'}\n\n"; }
Regards,
|
|---|