#!/usr/bin/perl @lines = <>; print "\n\n". "\n\n". "\n". " Slashdot\n". " http://slashdot.org/index.pl\n". " News for nerds, stuff that matters\n". " en\n". "\n\n"; $found = 0; foreach (@lines) { chomp; if ($_ eq "\tWIDTH=\"13\" HEIGHT=\"16\" ALT=\"\" ALIGN=\"TOP\">/) { /FONT COLOR=\"#FFFFFF\">(.*)<\/FONT><\/A>(.*)<\/B>/; $headline = $1.$2; } else { /(.*)<\/B>/; $headline = $1; } $found = 2; $headline =~ s/&/&/g; $headline =~ s//>/g; $headline =~ s/\"/"/g; $headline =~ s/\'/'/g; next; } if ((/^/) && ($found == 2)) { # Discard a whole bunch of crap $found = 3; next; } if ((/^./) && ($found == 3)) { if (/^./) { # In theory we've now hit the line with description and link $main = $_; $main =~ s/&/&/g; $main =~ s//>/g; $main =~ s/\"/"/g; $main =~ s/\'/'/g; $found = 4; } next; } elsif ($found == 3) { next; } if ((m/Read More/) && ($found == 4)) { $link = "http:".(split(/\"/,$_))[1]; $link = (split(/&/,$link))[0]; $found = 0; # Print out RSS item print "\n". "$headline\n". "$link\n". "$main\n\n\n"; } } print "\n";