|
MythTV
0.27pre
|
Go to the source code of this file.
Functions | |
| use lib | dirname (abs_path($0 or $PROGRAM_NAME)) |
| use Date::Calc | qw (Day_of_Week) |
| use lib | dirname ($0) |
| use MetOffCommon | qw (:DEFAULT $apikey) |
| 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 $locid &&!$locid eq"")) | |
| if (DateTime->now()->hour() >=18) | |
| $end_date | add (days=> 5) |
| if ($locid=~s/^(\d *)/$1/) | |
| if (!$xml) | |
| printf updatetime:: | localtime ()."\n" |
| foreach | $period (@{$xml->{DV}->{Location}->{Period}}) |
Variables | |
| use | strict |
| use | warnings |
| use | utf8 |
| use | English |
| use Cwd | abs_path |
| use lib usr share mythtv mythweather scripts | uk_metoffice |
| use | Switch |
| use | DateTime |
| my | $name = 'MetOffice-Forecast-API' |
| my | $version = 0.3 |
| my | $author = 'Stuart Morgan' |
| my | $email = 'smorgan@mythtv.org' |
| my | $updateInterval = 3*60*60 |
| my | $retrieveTimeout = 30 |
| my | types |
| my | $dir = "/tmp/uk_metoffice" |
| my | $logdir = "/tmp/uk_metoffice" |
| my | $units = "SI" |
| my | $locid = shift |
| my | $base_args = '?res=daily&key=' . $MetOffCommon::api_key |
| my | $start_date = DateTime->now()->set_hour(0)->set_minute(0)->set_second(0) |
| my | $end_date = $start_date->clone() |
| my | $url = "" |
| die unless defined | $response |
| my | $xml = XMLin($response) |
| printf copyright::$MetOffCommon::copyright_str | n |
| my | $location = $xml->{DV}->{Location}->{name} |
| my | $i = 0 |
| my | $period |
| use Date::Calc qw | ( | Day_of_Week | ) |
| use lib dirname | ( | $0 | ) |
| use MetOffCommon qw | ( | :DEFAULT | $apikey | ) |
| our | ( | $opt_v, | |
| $opt_t, | |||
| $opt_T, | |||
| $opt_l, | |||
| $opt_u, | |||
| $opt_d, | |||
| $opt_D | |||
| ) |
| binmode | ( | STDOUT | , |
| ":utf8" | |||
| ) |
| if | ( | !-d | $logdir | ) |
Definition at line 52 of file metoffice_fivedayapi.pl.
| getopts | ( | 'Tvtlu:d:' | ) |
| if | ( | defined | $opt_v | ) |
Definition at line 58 of file metoffice_fivedayapi.pl.
| if | ( | ! | defined $locid &&!$locid eq"" | ) |
Definition at line 104 of file metoffice_fivedayapi.pl.
| if | ( | DateTime->now()->hour() >= | 18 | ) |
Definition at line 114 of file metoffice_fivedayapi.pl.
| $end_date add | ( | days | , |
| 5 | |||
| ) |
Referenced by MythUIEditBar::AddBar(), MythUIEditBar::AddMark(), PlaybackBox::createJobMenu(), RomInfo::GetAllRomInfo(), if(), md5_process_bytes(), setScheduledWakeupTime(), WelcomeDialog::shutdownNow(), Scheduler::ShutdownServer(), GameScannerThread::updateDB(), write_ac3_pes(), write_ac3_ts(), write_audio_pes(), write_audio_ts(), write_video_pes(), and write_video_ts().
| if | ( | $locid = ~ s/^(\d*)/$1/ | ) |
Definition at line 124 of file metoffice_fivedayapi.pl.
| if | ( | ! | $xml | ) |
Definition at line 139 of file metoffice_fivedayapi.pl.
| printf updatetime:: localtime | ( | ) |
Referenced by localtime_r().
| foreach $period | ( | ) |
Definition at line 154 of file metoffice_fivedayapi.pl.
| use strict |
Definition at line 4 of file metoffice_fivedayapi.pl.
| use warnings |
Definition at line 5 of file metoffice_fivedayapi.pl.
| use encoding utf8 |
Definition at line 7 of file metoffice_fivedayapi.pl.
| use English |
Definition at line 9 of file metoffice_fivedayapi.pl.
| use Cwd abs_path |
Definition at line 12 of file metoffice_fivedayapi.pl.
| use lib usr share mythtv mythweather scripts usr local share mythtv mythweather scripts uk_metoffice |
Definition at line 14 of file metoffice_fivedayapi.pl.
| use Switch |
Definition at line 21 of file metoffice_fivedayapi.pl.
| use DateTime |
Definition at line 23 of file metoffice_fivedayapi.pl.
Referenced by MythCommandLineParser::add(), CommandLineArg::PrintVerbose(), XmlPListSerializer::RenderValue(), JSONSerializer::RenderValue(), XmlSerializer::RenderValue(), CommandLineArg::Set(), MythCommandLineParser::toDateTime(), and PList::ToXML().
Definition at line 32 of file metoffice_fivedayapi.pl.
| my $version = 0.3 |
Definition at line 33 of file metoffice_fivedayapi.pl.
| my $author = 'Stuart Morgan' |
Definition at line 34 of file metoffice_fivedayapi.pl.
Definition at line 35 of file metoffice_fivedayapi.pl.
| my $updateInterval = 3*60*60 |
Definition at line 37 of file metoffice_fivedayapi.pl.
| my $retrieveTimeout = 30 |
Definition at line 38 of file metoffice_fivedayapi.pl.
| my types |
Definition at line 39 of file metoffice_fivedayapi.pl.
| my $dir = "/tmp/uk_metoffice" |
Definition at line 47 of file metoffice_fivedayapi.pl.
| my $logdir = "/tmp/uk_metoffice" |
Definition at line 48 of file metoffice_fivedayapi.pl.
| my $units = "SI" |
Definition at line 96 of file metoffice_fivedayapi.pl.
| my $locid = shift |
Definition at line 101 of file metoffice_fivedayapi.pl.
| $base_args = '?res=daily&key=' . $MetOffCommon::api_key |
Definition at line 108 of file metoffice_fivedayapi.pl.
Referenced by if().
Definition at line 113 of file metoffice_fivedayapi.pl.
| my $end_date = $start_date->clone() |
Definition at line 117 of file metoffice_fivedayapi.pl.
Definition at line 122 of file metoffice_fivedayapi.pl.
Referenced by $contenturl(), and elsif().
Definition at line 134 of file metoffice_fivedayapi.pl.
| my $xml = XMLin($response) |
Definition at line 137 of file metoffice_fivedayapi.pl.
| printf:: $location n |
Definition at line 143 of file metoffice_fivedayapi.pl.
Definition at line 146 of file metoffice_fivedayapi.pl.
| my $i = 0 |
Definition at line 151 of file metoffice_fivedayapi.pl.
| my $period |
Definition at line 152 of file metoffice_fivedayapi.pl.
1.8.1.2