#!/usr/bin/perl =cut Copyright (c) 2001 Malte Starostik Unlimited use, modification and distribution granted as long as the above copyright statement and this sentence remain intact. =cut use strict; use LWP::Simple; print <<'EOT'; BBC News Headlines News from the BBC en-gb EOT my ($secnum, $section, $headline, $url); foreach (split /\r?\n/, get "http://tickers.bbc.co.uk/tickerdata/story2.dat") { $secnum = $1, $section = '' if (/^STORY ([\d+])/ && $1 != $secnum); if (/^HEADLINE (.+)/) { next if $1 =~ /Last update/; $headline = $1; $headline =~ s/&/&/g; $headline =~ s//>/g; $headline =~ s/"/"/g; $section = $headline, $section =~ s/\s*\d+ (Ja|Fe|Ma|Ap|Ju|Au|Se|Oc|No|De)\S+ \d+$// unless $section; } if (/^URL (.+)/) { $url = $1, $url =~ s/&/&/g; print < $headline ($section) $url EOT } } print <<'EOT'; EOT