|
MythTV
0.27pre
|
Go to the source code of this file.
Functions | |
| use lib | dirname (abs_path($0 or $PROGRAM_NAME)) |
| use POSIX | qw (strftime) |
| use Env | qw (HOME MYTHCONFDIR) |
| our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d, $opt_D) | |
| if (defined $MYTHCONFDIR) | |
| if ((!defined $MYTHCONFDIR)||($conffile &&!-f $conffile)) | |
| if (!-f $conffile) | |
| binmode (STDOUT,":utf8") | |
| if (!-d $logdir) | |
| getopts ('Tvtlu:d:D') | |
| if (not defined $rawloc or $rawloc eq"") | |
| log_print ($logdir,"-d $dir $loc\n") | |
| for my | $attr (sort keys%attrib) |
Variables | |
| use | English |
| use | strict |
| use | warnings |
| use Cwd | abs_path |
| use lib usr share mythtv mythweather scripts | wunderground |
| use | utf8 |
| use | JSON |
| my | $name = 'wunderground-maps' |
| my | $version = 0.3 |
| my | $author = 'Gavin Hurlbut' |
| my | $email = 'gjhurlbu@gmail.com' |
| my | $updateTimeout = 15*60 |
| my | $retrieveTimeout = 30 |
| my | types = ( 'smdesc', 'updatetime', 'map', 'copyright', 'copyrightlogo' ) |
| my | $dir = "/tmp/wunderground" |
| my | $logdir = "/tmp/wunderground" |
| my | $conffile |
| open | IF |
| chomp | $apikey |
| my | $rawloc = shift |
| my | $loc = uri_escape($rawloc) |
| my | attrib |
| my | $base_url = "http://api.wunderground.com/api/$apikey/geolookup/q/" |
| my | $hash |
| my | $location = location($hash->{'location'}) |
| my | $url = "width=1024&height=768&newmaps=1" |
| my | $now = time |
| exit | |
| use POSIX qw | ( | strftime | ) |
| use Env qw | ( | HOME | MYTHCONFDIR | ) |
| our | ( | $opt_v, | |
| $opt_t, | |||
| $opt_T, | |||
| $opt_l, | |||
| $opt_u, | |||
| $opt_d, | |||
| $opt_D | |||
| ) |
| if | ( | defined | $MYTHCONFDIR | ) |
Definition at line 38 of file wunderground-maps.pl.
| if | ( | (!defined $MYTHCONFDIR)||($conffile &&!-f $conffile) | ) |
Definition at line 42 of file wunderground-maps.pl.
| if | ( | !-f | $conffile | ) |
Definition at line 46 of file wunderground-maps.pl.
| binmode | ( | STDOUT | , |
| ":utf8" | |||
| ) |
| if | ( | !-d | $logdir | ) |
Definition at line 61 of file wunderground-maps.pl.
| getopts | ( | 'Tvtlu:d:D' | ) |
| if | ( | not defined $rawloc or $rawloc eq"" | ) |
Definition at line 115 of file wunderground-maps.pl.
| log_print | ( | $logdir, | |
| "-d $dir $loc\n" | |||
| ) |
| for my $attr | ( | sort keys% | attrib | ) |
Definition at line 141 of file wunderground-maps.pl.
| use English |
Definition at line 4 of file wunderground-maps.pl.
| use strict |
Definition at line 5 of file wunderground-maps.pl.
| use warnings |
Definition at line 6 of file wunderground-maps.pl.
| use Cwd abs_path |
Definition at line 10 of file wunderground-maps.pl.
| use lib usr share mythtv mythweather scripts usr local share mythtv mythweather scripts wunderground |
Definition at line 12 of file wunderground-maps.pl.
| use encoding utf8 |
Definition at line 15 of file wunderground-maps.pl.
| use JSON |
Definition at line 21 of file wunderground-maps.pl.
| my $name = 'wunderground-maps' |
Definition at line 26 of file wunderground-maps.pl.
| my $version = 0.3 |
Definition at line 27 of file wunderground-maps.pl.
| my $author = 'Gavin Hurlbut' |
Definition at line 28 of file wunderground-maps.pl.
Definition at line 29 of file wunderground-maps.pl.
| my $updateTimeout = 15*60 |
Definition at line 30 of file wunderground-maps.pl.
| my $retrieveTimeout = 30 |
Definition at line 31 of file wunderground-maps.pl.
| my types = ( 'smdesc', 'updatetime', 'map', 'copyright', 'copyrightlogo' ) |
Definition at line 32 of file wunderground-maps.pl.
| my $dir = "/tmp/wunderground" |
Definition at line 33 of file wunderground-maps.pl.
| my $logdir = "/tmp/wunderground" |
Definition at line 34 of file wunderground-maps.pl.
| my $conffile |
Definition at line 36 of file wunderground-maps.pl.
| open<",$conffileordie"Couldn'tread$conffile:$!\n";my$apikey=<IF> close IF |
Definition at line 54 of file wunderground-maps.pl.
| chomp $apikey |
Definition at line 57 of file wunderground-maps.pl.
| my $rawloc = shift |
Definition at line 114 of file wunderground-maps.pl.
| my $loc = uri_escape($rawloc) |
Definition at line 118 of file wunderground-maps.pl.
| my attrib |
Definition at line 120 of file wunderground-maps.pl.
| my $base_url = "http://api.wunderground.com/api/$apikey/geolookup/q/" |
Definition at line 124 of file wunderground-maps.pl.
| my $hash |
Definition at line 126 of file wunderground-maps.pl.
| my $location = location($hash->{'location'}) |
Definition at line 128 of file wunderground-maps.pl.
Definition at line 130 of file wunderground-maps.pl.
| my $now = time |
Definition at line 138 of file wunderground-maps.pl.
| exit |
Definition at line 144 of file wunderground-maps.pl.
1.8.1.2