From 84da08d7b7fcda12c85caeb5a10b4903770a6f69 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- knewsticker-scripts/bbc.pl | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 knewsticker-scripts/bbc.pl (limited to 'knewsticker-scripts/bbc.pl') diff --git a/knewsticker-scripts/bbc.pl b/knewsticker-scripts/bbc.pl new file mode 100755 index 0000000..78cb4e3 --- /dev/null +++ b/knewsticker-scripts/bbc.pl @@ -0,0 +1,54 @@ +#!/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 -- cgit v1.2.1