MythTV  0.26-pre
Functions | Variables
wunderground.pl File Reference

Go to the source code of this file.

Functions

use POSIX qw (strftime)
 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 $loc &&!$loc eq""))
 log_print ($logdir,"-u $units -d $dir $loc\n")
foreach $node ($nodeset->get_nodelist)
foreach my $hashref (@forecast)
for my $attr (sort keys%attrib)

Variables

use strict
use warnings
use utf8
my $name = 'wunderground'
my $version = 0.1
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 $rawloc = shift
my $loc = uri_escape($rawloc)
my attrib
my $units = $opt_u
my $base_url
 $file
my $nodeset = $xp->find('/forecast/simpleforecast/forecastday')
my $node
my $now = time
my forecast
my $day = 0
my $time = 0
 exit

Function Documentation

use POSIX qw ( strftime  )
our ( opt_v,
opt_t,
opt_T,
opt_l,
opt_u,
opt_d,
opt_D 
)
binmode ( STDOUT  ,
":utf8"   
)
if ( !-d logdir)

Definition at line 44 of file wunderground.pl.

getopts ( 'Tvtlu:d:'  )
if ( defined $  opt_v)

Definition at line 50 of file wunderground.pl.

if ( defined $opt_u &&defined $loc &&!$loc eq"")

Definition at line 116 of file wunderground.pl.

log_print ( logdir,
"-u $units -d $dir $loc\n  
)
foreach $node ( $nodeset->  get_nodelist)

Definition at line 151 of file wunderground.pl.

foreach my $hashref ( forecast)

Definition at line 167 of file wunderground.pl.

for my $attr ( sort keys%  attrib)

Definition at line 191 of file wunderground.pl.


Variable Documentation

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.

Definition at line 19 of file wunderground.pl.

my $version = 0.1

Definition at line 20 of file wunderground.pl.

my $author = 'Gavin Hurlbut'

Definition at line 21 of file wunderground.pl.

my $email = 'gjhurlbu@gmail.com'

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.

Initial value:
 ( '3dlocation', '6dlocation', 'cclocation', 'copyright', 
              'date-0', 'date-1', 'date-2', 'date-3', 'date-4', 'date-5', 
              'high-0', 'high-1', 'high-2', 'high-3', 'high-4', 'high-5',
              'low-0', 'low-1', 'low-2', 'low-3', 'low-4', 'low-5',
              'icon-0', 'icon-1', 'icon-2', 'icon-3', 'icon-4', 'icon-5',
              'observation_time', 'updatetime', 'station_id' )

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.

Initial value:
 ( "clear" => "fair.png", "cloudy" => "cloudy.png",
               "flurries" => "flurries.png", "fog" => "fog.png",
               "hazy" => "fog.png", "mostlycloudy" => "mcloudy.png",
               "mostlysunny" => "pcloudy.png", "partlycloudy" => "pcloudy.png",
               "partlysunny" => "mcloudy.png", "rain" => "showers.png",
               "sleet" => "rainsnow.png", "snow" => "flurries.png",
               "sunny" => "sunny.png", "tstorms" => "thunshowers.png",
               "unknown" => "unknown.png" )

Definition at line 33 of file wunderground.pl.

my $rawloc = shift

Definition at line 114 of file wunderground.pl.

my $loc = uri_escape($rawloc)

Definition at line 115 of file wunderground.pl.

Definition at line 120 of file wunderground.pl.

my $units = $opt_u

Definition at line 121 of file wunderground.pl.

my $base_url
Initial value:
 
     'http:
my $file = $loc

Definition at line 125 of file wunderground.pl.

$file
Initial value:
~ s/\

my $xp = getCachedXML($base_url . $loc, $dir, $file . ".xml",
                      $updateTimeout, $logdir)

Definition at line 128 of file wunderground.pl.

$nodeset = $xp->find('/forecast/simpleforecast/forecastday')

Definition at line 133 of file wunderground.pl.

my $node

Definition at line 136 of file wunderground.pl.

my $now = time

Definition at line 144 of file wunderground.pl.

Definition at line 145 of file wunderground.pl.

my $day = 0

Definition at line 158 of file wunderground.pl.

my $time = 0

Definition at line 159 of file wunderground.pl.

Definition at line 194 of file wunderground.pl.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends