##################### # # # Slashdot.pl for # # SlashDot headline # # retrival # # tessone@imsa.edu # # Chris Tessone # # Licensing: # # Artistic License # # (as perl itself) # ##################### #fixed up to use XML'd /. backdoor 7/31 by richardh@rahga.com #My only request if this gets included in infobot is that the #other header gets trimmed to 2 lines, dump the fluff ;) -rah #added a status message so people know to install LWP - oznoid #also simplified the return code because it wasn't working. use strict; my $no_slashlines; BEGIN { $no_slashlines = 0; eval "use LWP::UserAgent"; $no_slashlines++ if $@; } sub getslashdotheads { # configure if ($no_slashlines) { &status("slashdot headlines requires LWP to be installed"); return ''; } my $ua = new LWP::UserAgent; if (my $proxy = main::getparam('httpproxy')) { $ua->proxy('http', $proxy) }; $ua->timeout(12); my $maxheadlines=5; my $slashurl='http://www.slashdot.org/slashdot.xml'; my $story=0; my $slashindex = new HTTP::Request('GET',$slashurl); my $response = $ua->request($slashindex); if($response->is_success) { $response->content =~ /