Ticket #7128: 7128.diff
File 7128.diff, 9.2 KB (added by , 11 years ago) |
---|
-
mythplugins/mythweather/mythweather/scripts/README
67 67 pause text or the current date and time. A + prepending the item name signifies 68 68 an item that is required to show the screen, these are provided by scripts. The 69 69 text of the name within the weather-ui.xml file (with prepending flag removed) 70 must match exactly the string returned by the -Tflag; as well as the token70 must match exactly the string returned by the '-t' flag; as well as the token 71 71 returned when retrieving data. 72 72 73 73 If you want to see the code that controls the scripts within the plugin, look at -
mythplugins/mythweather/mythweather/scripts/us_nws/ndfd.pl
14 14 our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d); 15 15 16 16 my $name = 'NDFD-6_day'; 17 my $version = 0. 1;17 my $version = 0.2; 18 18 my $author = 'Lucien Dunning'; 19 19 my $email = 'ldunning@gmail.com'; 20 20 my $updateTimeout = 15*60; … … 23 23 'high-0', 'high-1', 'high-2', 'high-3', 'high-4', 'high-5', 24 24 'low-0', 'low-1', 'low-2', 'low-3', 'low-4', 'low-5', 25 25 'icon-0', 'icon-1', 'icon-2', 'icon-3', 'icon-4', 'icon-5', 26 'date-0', 'date-1', 'date-2', 'date-3', 'date-4', 'date-5' );26 'date-0', 'date-1', 'date-2', 'date-3', 'date-4', 'date-5', 'copyright'); 27 27 my $dir = './'; 28 28 getopts('Tvtlu:d:'); 29 29 … … 141 141 printf "updatetime::Last Updated on %s\n", 142 142 UnixDate($creationdate, "%b %d, %I:%M %p %Z"); 143 143 144 printf "copyright::National Digital Forecast Database\n"; 145 144 146 foreach $time (sort(keys(%$result))) { 145 147 my $date; 146 148 if ($time =~ m/,/) { -
mythplugins/mythweather/mythweather/scripts/us_nws/nws-alert.pl
102 102 our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d); 103 103 104 104 my $name = 'NWS-Alerts'; 105 my $version = 0. 1;105 my $version = 0.2; 106 106 my $author = 'Lucien Dunning'; 107 107 my $email = 'ldunning@gmail.com'; 108 108 my $updateTimeout = 10*60; 109 109 my $retrieveTimeout = 30; 110 my @types = ('swlocation', 'updatetime', 'alerts' );110 my @types = ('swlocation', 'updatetime', 'alerts', 'copyright'); 111 111 my $dir = "./"; 112 112 113 113 getopts('Tvtlu:d:'); … … 182 182 183 183 print "updatetime::Last Updated on " . 184 184 UnixDate(Date_ConvTZ(ParseDate($updatetime)), "%b %d, %I:%M %p %Z") . "\n"; 185 print "copyright::NOAA,National Weather Service\n"; 185 186 186 187 sub doLocation { 187 188 my $code = shift; -
mythplugins/mythweather/mythweather/scripts/us_nws/ndfd18.pl
9 9 our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d); 10 10 11 11 my $name = 'NDFD-18_Hour'; 12 my $version = 0. 1;12 my $version = 0.2; 13 13 my $author = 'Lucien Dunning'; 14 14 my $email = 'ldunning@gmail.com'; 15 15 my $updateTimeout = 15*60; … … 18 18 'temp-0', 'temp-1', 'temp-2', 'temp-3', 'temp-4', 'temp-5', 19 19 '18icon-0', '18icon-1', '18icon-2', '18icon-3', '18icon-4', '18icon-5', 20 20 'pop-0', 'pop-1', 'pop-2', 'pop-3', 'pop-4', 'pop-5', 21 'time-0', 'time-1', 'time-2', 'time-3', 'time-4', 'time-5' );21 'time-0', 'time-1', 'time-2', 'time-3', 'time-4', 'time-5', 'copyright'); 22 22 my $dir = './'; 23 23 24 24 getopts('Tvtlu:d:'); … … 130 130 my $icon; 131 131 printf "updatetime::Last Updated on %s\n", 132 132 UnixDate($creationdate, "%b %d, %I:%M %p %Z"); 133 printf "copyright::National Digital Forecast Database\n"; 133 134 my $pop12; 134 135 foreach my $time (sort keys %$result) { 135 136 if (defined $result->{$time}->{'probability-of-precipitation_12 hour'}) { -
mythplugins/mythweather/mythweather/scripts/us_nws/nwsxml.pl
10 10 our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d); 11 11 12 12 my $name = 'NWS-XML'; 13 my $version = 0. 2;13 my $version = 0.3; 14 14 my $author = 'Lucien Dunning'; 15 15 my $email = 'ldunning@gmail.com'; 16 16 my $updateTimeout = 15*60; … … 21 21 'wind_dir', 'wind_degrees', 'wind_speed', 'wind_gust', 22 22 'pressure_string', 'pressure', 'dewpoint_string', 'dewpoint', 23 23 'heat_index_string', 'heat_index', 'windchill_string', 'windchill', 24 'visibility', 'weather_icon', 'appt', 'wind_spdgst' );24 'visibility', 'weather_icon', 'appt', 'wind_spdgst', 'copyright'); 25 25 my $dir = "./"; 26 26 27 27 getopts('Tvtlu:d:'); … … 99 99 $xml->{$key} = int($xml->{'wind_mph'} * 1.609344 + .5); 100 100 } 101 101 } elsif (/wind_gust/) { 102 if ($units =~ /ENG/ || $xml->{'wind_gust_mph'} eq 'NA') { 103 $key = 'wind_gust_mph'; 102 if (defined($xml->{'wind_gust_mph'})) { 103 if ($units =~ /ENG/ || $xml->{'wind_gust_mph'} eq 'NA') { 104 $key = 'wind_gust_mph'; 105 } else { 106 $key = 'wind_gust_kph'; 107 $xml->{$key} = int($xml->{'wind_gust_mph'} * 1.609344 + .5); 108 } 104 109 } else { 105 $key = 'wind_gust_kph'; 106 $xml->{$key} = int($xml->{'wind_gust_mph'} * 1.609344 + .5); 110 $xml->{'wind_gust_mph'} = 'NA'; 111 $xml->{'wind_gust_kph'} = 'NA'; 112 $key = 'wind_gust'; 107 113 } 108 114 } elsif (/visibility/) { 109 115 if ($units =~ /ENG/) { … … 128 134 } elsif (/cclocation/) { 129 135 $key = 'location'; 130 136 } elsif (/appt$/) { 131 if ($xml->{windchill_f} eq 'NA') { 132 $key = 'heat_index_f' if ($units =~ /ENG/); 133 $key = 'heat_index_c' if ($units =~ /SI/); 134 } else { 135 $key = 'windchill_f' if ($units =~ /ENG/); 136 $key = 'windchill_c' if ($units =~ /SI/); 137 }; 138 137 if (defined($xml->{windchill_f})) { 138 if ($xml->{windchill_f} eq 'NA') { 139 $key = 'heat_index_f' if ($units =~ /ENG/); 140 $key = 'heat_index_c' if ($units =~ /SI/); 141 } else { 142 $key = 'windchill_f' if ($units =~ /ENG/); 143 $key = 'windchill_c' if ($units =~ /SI/); 144 }; 145 } else { 146 $key = 'appt'; 147 } 139 148 } elsif (/wind_spdgst/) { 140 149 # relying on this being after speed and gust 141 150 $key = "wind_spdgst"; … … 144 153 } else { 145 154 $xml->{$key} = "$xml->{wind_kph} ($xml->{wind_gust_kph}) kph"; 146 155 } 147 156 } elsif (/copyright/) { 157 $key = "copyright"; 158 $xml->{$key} = $xml->{credit}; 148 159 } else { 149 160 $key = $label; 150 161 } 151 printf $label . "::" . $xml->{$key}. "\n"; 162 163 print $label . "::"; 164 if (defined($xml->{$key})) { 165 print $xml->{$key}; 166 } else { 167 print "NA"; 168 } 169 print "\n"; 152 170 } -
mythplugins/mythweather/mythweather/scripts/us_nws/animaps.pl
8 8 our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d); 9 9 10 10 my $name = 'Animated-Map-Download'; 11 my $version = 0. 1;11 my $version = 0.2; 12 12 my $author = 'Lucien Dunning'; 13 13 my $email = 'ldunning@gmail.com'; 14 14 my $updateTimeout = 10*60; 15 15 my $retrieveTimeout = 30; 16 my @types = ('amdesc', 'updatetime', 'animatedimage' );16 my @types = ('amdesc', 'updatetime', 'animatedimage', 'copyright'); 17 17 my $dir = "./"; 18 18 19 19 getopts('Tvtlu:d:'); … … 75 75 print "amdesc::$desc\n"; 76 76 printf "animatedimage::${path}%%1-$i%s\n", ($size && "-$size" || ''); 77 77 print "updatetime::Last Updated on " . UnixDate("now", "%b %d, %I:%M %p %Z") . "\n"; 78 print "copyright::The Weather Channel Interactive, Inc.\n"; -
mythplugins/mythweather/mythweather/scripts/us_nws/maps.pl
8 8 our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d); 9 9 10 10 my $name = 'Map-Download'; 11 my $version = 0. 1;11 my $version = 0.2; 12 12 my $author = 'Lucien Dunning'; 13 13 my $email = 'ldunning@gmail.com'; 14 14 my $updateTimeout = 10*60; 15 15 my $retrieveTimeout = 30; 16 my @types = ('smdesc', 'updatetime', 'map' );16 my @types = ('smdesc', 'updatetime', 'map', 'copyright'); 17 17 my $dir = "./"; 18 18 19 19 getopts('Tvtlu:d:'); … … 70 70 print "smdesc::$desc\n"; 71 71 printf "map::$path%s\n", ($size && "-$size" || ''); 72 72 print "updatetime::Last Updated on " . UnixDate("now", "%b %d, %I:%M %p %Z") . "\n"; 73 print "copyright::The Weather Channel Interactive, Inc.\n";