Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: Slashdot Headline Grabber for *nix

by merlyn (Sage)
on Jul 11, 2000 at 03:43 UTC ( #21890=note: print w/replies, xml ) Need Help??


in reply to Slashdot Headline Grabber for *nix

Much simpler to grab the RSS RDF file instead. And it can be parsed by XML::RSS rather directly. I have a WebTechniques column that fetches RSS files on a regular basis, sending you just the updated headlines.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: RE: Slashdot Headline Grabber for *nix
by maksl (Pilgrim) on May 19, 2003 at 21:20 UTC
    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', 'http://slashdot.org/slashdot.rdf'] # 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2023-12-07 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (32 votes). Check out past polls.

    Notices?