bbccurrentxml.pl File Reference
Go to the source code of this file.
Functions |
| use lib | dirname (abs_path($0 or $PROGRAM_NAME)) |
| use lib | dirname ($0) |
| | our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d, $opt_D) |
| | binmode (STDOUT,":utf8") |
| | if (!-d $logdir) |
| | getopts ('Tvtlu:d:') |
| | if (defined $opt_v) |
| | if (!(defined $opt_u &&defined $locid &&!$locid eq"")) |
| | if ($locid=~s/^(\d *)/$1/) |
| | if (!$xml) |
| | elsif ($weather_string=~/^fog $/i||$weather_string=~/^foggy $/i||$weather_string=~/^mist $/i||$weather_string=~/^misty $/i) |
| | foreach (@data) |
Variables |
| use | strict |
| use | warnings |
| use | utf8 |
| use | English |
| use Cwd | abs_path |
use lib usr share mythtv
mythweather scripts | uk_bbc |
| use | BBCLocation |
| my | $name = 'BBC-Current-XML' |
| my | $version = 0.3 |
| my | $author = 'Gavin Hurlbut / Stuart Morgan' |
| my | $email = 'gjhurlbu@gmail.com / stuart@tase.co.uk' |
| my | $updateTimeout = 120*60 |
| my | $retrieveTimeout = 30 |
| my | types |
| my | $dir = "/tmp/uk_bbc" |
| my | $logdir = "/tmp/uk_bbc" |
| my | $locid = BBCLocation::FindLoc(shift, $dir, $updateTimeout, $logdir) |
| my | $units = $opt_u |
| my | $base_url |
| die unless defined | $response |
| my | $xml = XMLin($response) |
| printf appt::NA | n |
| my | $location = $xml->{channel}->{title} |
| my | $item_title = $xml->{channel}->{item}->{title} |
| my | $obs_time = $1 if ($item_title =~ /(^.*)\:.*/) |
| my | $weather_string = $item_title |
Function Documentation
| our |
( |
$ |
opt_v, |
|
|
$ |
opt_t, |
|
|
$ |
opt_T, |
|
|
$ |
opt_l, |
|
|
$ |
opt_u, |
|
|
$ |
opt_d, |
|
|
$ |
opt_D | |
|
) |
| | |
| binmode |
( |
STDOUT |
, |
|
|
":utf8" |
| |
|
) |
| | |
| if |
( |
! |
defined $opt_u &&defined $locid &&!$locid eq"" |
) |
|
| if |
( |
$ |
locid = ~ s/^(\d*)/$1/ |
) |
|
| elsif |
( |
$ |
weather_string = ~ /^fog$/i || $weather_string =~ /^foggy$/i || $weather_string =~ /^mist$/i || $weather_string =~ /^misty$/i |
) |
|
Variable Documentation
| use lib usr share mythtv mythweather scripts usr local share mythtv mythweather scripts uk_bbc |
| my $name = 'BBC-Current-XML' |
| my $author = 'Gavin Hurlbut / Stuart Morgan' |
| my $email = 'gjhurlbu@gmail.com / stuart@tase.co.uk' |
| my $updateTimeout = 120*60 |
Initial value: ('cclocation', 'station_id', 'copyright',
'observation_time', 'weather', 'temp', 'relative_humidity',
'wind_dir', 'pressure', 'visibility', 'weather_icon',
'appt', 'wind_spdgst')
Definition at line 35 of file bbccurrentxml.pl.
| my $locid = BBCLocation::FindLoc(shift, $dir, $updateTimeout, $logdir) |
Initial value: 'http:
my $base_xml = '/ObservationsRSS.xml'
Definition at line 96 of file bbccurrentxml.pl.
| die unless defined $response |
| my $xml = XMLin($response) |
| printf weather:: $weather_string n |
| $location = $xml->{channel}->{title} |
| my $item_title = $xml->{channel}->{item}->{title} |
| my $obs_time = $1 if ($item_title =~ /(^.*)\:.*/) |
| $weather_string = $item_title |