|
MythTV
0.26-pre
|
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 |
| our | ( | $ | opt_v, |
| $ | opt_t, | ||
| $ | opt_T, | ||
| $ | opt_l, | ||
| $ | opt_u, | ||
| $ | opt_d, | ||
| $ | opt_D | ||
| ) |
| binmode | ( | STDOUT | , |
| ":utf8" | |||
| ) |
Definition at line 44 of file bbccurrentxml.pl.
| getopts | ( | 'Tvtlu:d:' | ) |
| if | ( | defined $ | opt_v | ) |
Definition at line 50 of file bbccurrentxml.pl.
| if | ( | ! | defined $opt_u &&defined $locid &&!$locid eq"" | ) |
Definition at line 91 of file bbccurrentxml.pl.
Definition at line 99 of file bbccurrentxml.pl.
| if | ( | !$ | xml | ) |
Definition at line 113 of file bbccurrentxml.pl.
| elsif | ( | $ | weather_string = ~ /^fog$/i || $weather_string =~ /^foggy$/i || $weather_string =~ /^mist$/i || $weather_string =~ /^misty$/i | ) |
Definition at line 141 of file bbccurrentxml.pl.
| foreach | ( | @ | data | ) |
Definition at line 191 of file bbccurrentxml.pl.
| use strict |
Definition at line 4 of file bbccurrentxml.pl.
| use warnings |
Definition at line 5 of file bbccurrentxml.pl.
| use encoding utf8 |
Definition at line 7 of file bbccurrentxml.pl.
| use English |
Definition at line 9 of file bbccurrentxml.pl.
| use Cwd abs_path |
Definition at line 12 of file bbccurrentxml.pl.
Definition at line 14 of file bbccurrentxml.pl.
| use BBCLocation |
Definition at line 24 of file bbccurrentxml.pl.
Definition at line 28 of file bbccurrentxml.pl.
| my $version = 0.3 |
Definition at line 29 of file bbccurrentxml.pl.
| my $author = 'Gavin Hurlbut / Stuart Morgan' |
Definition at line 30 of file bbccurrentxml.pl.
Definition at line 31 of file bbccurrentxml.pl.
| my $updateTimeout = 120*60 |
Definition at line 32 of file bbccurrentxml.pl.
| my $retrieveTimeout = 30 |
Definition at line 34 of file bbccurrentxml.pl.
('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.
Definition at line 39 of file bbccurrentxml.pl.
Definition at line 40 of file bbccurrentxml.pl.
| my $locid = BBCLocation::FindLoc(shift, $dir, $updateTimeout, $logdir) |
Definition at line 90 of file bbccurrentxml.pl.
| my $units = $opt_u |
Definition at line 95 of file bbccurrentxml.pl.
| my $base_url |
'http: my $base_xml = '/ObservationsRSS.xml'
Definition at line 96 of file bbccurrentxml.pl.
Definition at line 108 of file bbccurrentxml.pl.
| my $xml = XMLin($response) |
Definition at line 111 of file bbccurrentxml.pl.
| printf weather:: $weather_string n |
Definition at line 118 of file bbccurrentxml.pl.
| $location = $xml->{channel}->{title} |
Definition at line 122 of file bbccurrentxml.pl.
| my $item_title = $xml->{channel}->{item}->{title} |
Definition at line 126 of file bbccurrentxml.pl.
Definition at line 128 of file bbccurrentxml.pl.
| $weather_string = $item_title |
Definition at line 130 of file bbccurrentxml.pl.
1.7.6.1