|
MythTV
0.27pre
|
Go to the source code of this file.
Functions | |
| 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:') | |
| if (!(defined $opt_u &&defined $loc &&!$loc eq"")) | |
| log_print ($logdir,"-u $units -d $dir $loc\n") | |
| foreach my | $hashref (@{$forecast}) |
| for my | $attr (sort keys%attrib) |
Variables | |
| use | strict |
| use | warnings |
| use | utf8 |
| use | JSON |
| my | $name = 'wunderground' |
| my | $version = 0.2 |
| my | $author = 'Gavin Hurlbut' |
| my | $email = 'gjhurlbu@gmail.com' |
| my | $updateTimeout = 15*60 |
| my | $retrieveTimeout = 30 |
| my | types |
| my | $dir = "/tmp/wunderground" |
| my | $logdir = "/tmp/wunderground" |
| my | images |
| my | $conffile |
| open | IF |
| chomp | $apikey |
| my | $rawloc = shift |
| my | $loc = uri_escape($rawloc) |
| my | attrib |
| my | $units = $opt_u |
| my | $base_url = "http://api.wunderground.com/api/$apikey/geolookup/forecast10day/q/" |
| my | $file = $loc |
| my | $hash |
| my | $location = location($hash->{'location'}) |
| my | $now = time |
| my | $forecast = $hash->{'forecast'}->{'simpleforecast'}->{'forecastday'} |
| my | $day = 0 |
| my | $time = 0 |
| 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 43 of file wunderground.pl.
| if | ( | (!defined $MYTHCONFDIR)||($conffile &&!-f $conffile) | ) |
Definition at line 47 of file wunderground.pl.
| if | ( | !-f | $conffile | ) |
Definition at line 51 of file wunderground.pl.
| binmode | ( | STDOUT | , |
| ":utf8" | |||
| ) |
| if | ( | !-d | $logdir | ) |
Definition at line 66 of file wunderground.pl.
| getopts | ( | 'Tvtlu:d:' | ) |
| if | ( | ! | defined $opt_u &&defined $loc &&!$loc eq"" | ) |
Definition at line 121 of file wunderground.pl.
Definition at line 165 of file wunderground.pl.
| for my $attr | ( | sort keys% | attrib | ) |
Definition at line 189 of file wunderground.pl.
| use strict |
Definition at line 4 of file wunderground.pl.
| use warnings |
Definition at line 5 of file wunderground.pl.
| use encoding utf8 |
Definition at line 7 of file wunderground.pl.
| use JSON |
Definition at line 14 of file wunderground.pl.
| my $name = 'wunderground' |
Definition at line 19 of file wunderground.pl.
| my $version = 0.2 |
Definition at line 20 of file wunderground.pl.
| my $author = 'Gavin Hurlbut' |
Definition at line 21 of file wunderground.pl.
Definition at line 22 of file wunderground.pl.
| my $updateTimeout = 15*60 |
Definition at line 23 of file wunderground.pl.
| my $retrieveTimeout = 30 |
Definition at line 24 of file wunderground.pl.
| my types |
Definition at line 25 of file wunderground.pl.
| my $dir = "/tmp/wunderground" |
Definition at line 31 of file wunderground.pl.
| my $logdir = "/tmp/wunderground" |
Definition at line 32 of file wunderground.pl.
| my images |
Definition at line 33 of file wunderground.pl.
| my $conffile |
Definition at line 41 of file wunderground.pl.
| open<",$conffileordie"Couldn'tread$conffile:$!\n";my$apikey=<IF> close IF |
Definition at line 59 of file wunderground.pl.
| chomp $apikey |
Definition at line 62 of file wunderground.pl.
| my $rawloc = shift |
Definition at line 119 of file wunderground.pl.
| my $loc = uri_escape($rawloc) |
Definition at line 120 of file wunderground.pl.
| my attrib |
Definition at line 125 of file wunderground.pl.
| my $units = $opt_u |
Definition at line 126 of file wunderground.pl.
| my $base_url = "http://api.wunderground.com/api/$apikey/geolookup/forecast10day/q/" |
Definition at line 130 of file wunderground.pl.
| my $file = $loc |
Definition at line 132 of file wunderground.pl.
| my $hash |
Definition at line 134 of file wunderground.pl.
| my $location = location($hash->{'location'}) |
Definition at line 139 of file wunderground.pl.
| my $now = time |
Definition at line 147 of file wunderground.pl.
Definition at line 152 of file wunderground.pl.
Referenced by $hashref().
| my $day = 0 |
Definition at line 156 of file wunderground.pl.
| my $time = 0 |
Definition at line 157 of file wunderground.pl.
| exit |
Definition at line 192 of file wunderground.pl.
1.8.1.2