#!/usr/bin/perl -w use strict; use XML::RSS; use LWP::Simple; my $page = get('http://www.thesun.co.uk/section/0,,4,00.html'); my $rss = new XML::RSS (version => '1.0'); $rss->channel(title => 'The Sun: Bizarre', link => 'http://www.thesun.co.uk/section/0,,4,00.html', description => 'The Sun: Bizarre'); # Eek! .* is a bit much, though it works. # Matches top story if ($page =~ m!\"([^"]*)\"!)add_item(title => "$2", link => 'http://www.thesun.co.uk' . $1); } # Other stories my @lines = split ("<[tT][Rr]", $page); foreach (@lines) { if (m!]*>]*>([^<]*)
[\r\n]*]*>([^<]*)[\r\n]*<[/]?td!is) { # print "$2, $3, $4"; $rss->add_item(title => "$3", link => 'http://www.thesun.co.uk' . $2, description => "$4"); } } print $rss->as_string;