Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: RE: Slashdot Headline Grabber for *nix

by maksl (Pilgrim)
on May 19, 2003 at 21:20 UTC ( #259297=note: print w/replies, xml ) Need Help??

in reply to RE: Slashdot Headline Grabber for *nix
in thread Slashdot Headline Grabber for *nix

indeed it's much simpler to grab the rss rdf file with LWP::Simple && parse with XML::RSS :)
code example:
#!/usr/bin/perl -w use strict; use XML::RSS; use LWP::Simple; my $news = ( 'slashdot' => ['Slashdot', ''] # add some more rss news sites .. ); foreach my $news ( keys %news) { $rsspage=get $news{$news}[1]; print "$news{$news}[0]:\n"; $rss = new XML::RSS; $rss->parse($rsspage); foreach my $item (@{$rss->{'items'}}) { print "\t$item->{'title'}\n"; print "\t$item->{'link'}\n\n"; } }
just add the timer for your convinience :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259297]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-10-22 20:25 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (297 votes). Check out past polls.