WORLD CUP TICKER
June 09, 2006
by: jovial_cynic
by: jovial_cynic
If you're reading this during the World Cup, you'll notice a little game-score ticker in the upper-right section of the text area. If you like it and are using Perl for your website, you can use this code:
use LWP 5.64;
my $browser = LWP::UserAgent->new;
$url = "http://newsimg.bbc.co.uk/sol/shared/bsp/hi/football/in_vision/html/in_vision1.stm";
my $response = $browser->get($url);
$messageBody = $response->content;
$messageBody =~ m/(.*?) /sg;
$title = $1;
print $1;
I've left off the formatting so you can display the ticker any way you want to.
UPDATE: The ticker isn't working properly. BBC news seems to have changed the way they're posting the scores, to my ticker can't grab anything useful. Sucks. I'll see if I can find another good source of the scores.
use LWP 5.64;
my $browser = LWP::UserAgent->new;
$url = "http://newsimg.bbc.co.uk/sol/shared/bsp/hi/football/in_vision/html/in_vision1.stm";
my $response = $browser->get($url);
$messageBody = $response->content;
$messageBody =~ m/
$title = $1;
print $1;
I've left off the formatting so you can display the ticker any way you want to.
UPDATE: The ticker isn't working properly. BBC news seems to have changed the way they're posting the scores, to my ticker can't grab anything useful. Sucks. I'll see if I can find another good source of the scores.