This script will provide you will the last 24 hour extremes for your country or area using international
metar climate reports provided by ogimet.
To name a few, the extremes are based on multiple stations that submit metar information:
United States: 1345 stations
United Kingdom: 146 stations
Canada: 757 stations
(There are about 150 countries to choose)
The script will provide an output of the top 10 for each category (Max Temp., Min. Temp, and Precip.)
The script is 100% XHTML 1.0 Transitional.
Feel free to use and alter as you wish.
Full Version History
(02-Dec-10) Version 0.5 – Added multi-area functionality (Thanks to Ray @ Tzouhalem-Maple Bay Weather www.tzweather.org !!)
(26-Nov-10) Version 0.4 – Improved ogimet server overloading handling function.
(25-Nov-10) Version 0.3 – Added ogimet server overload handling.
(24-Nov-10) Version 0.2 – Added Station Identification to tables and ID Lookup.
(23-Nov-10) Version 0.1 – Updated the script to change the temp or precip values font color to suite the cell background color. There were some instances of black font w/ very dark cell color which made it hard to read.
Menubar Version History
(28-Nov-10) Version 0.4 – Improved shortened location and station removal setup
(26-Nov-10) Version 0.3 – Script now outputs shortened location
(26-Nov-10) Version 0.2 – Improved ogimet server overloading handling function. Removed UTC timezone set (not needed)
(24-Nov-10) Version 0.1 – Add the ability to remove any unwanted stations from the output. Added ogimet server overload handling.
Can St Helena (in the south Atlantic) be excluded from the UK values as it will generally show the highest temperature (particularly at this time of year)?
Munro,
Something can be done I’m sure…I just need a bit of time to look at it. Would telling the script to always grab the second value and treat as #1 be ok?
I’ve updated the script to change the temp or precip values font color to suite the cell background color. There were some instances of black font w/ very dark cell color which made it hard to read.
As the old Red Rose Tea commercial stated “Only in Canada, eh? Pity!”
I tried both scripts, the main script worked “out of the box” so to speak, the Gadget on the other hand, no amount of coaxing will get it to display anything but what shows in the attachment. #-o ](*,)
The values jive with the main script, just the locations are lost in the wind.
For the menubar version, I’ve added the ability to skip an undesired station or stations. For example, the United States will always show Guam, Pago Pago and Marshall Islands are the high temps this time of year as they are US Territories. It will also show Henry (Antarctica) as a possible highest cold location. You can skip stations.
How to accomplish:
Find the undesired location 5-digit station number by looking at the URL string (ind=XXXXX)
91765=Pago Pago
91375=Marshall Islands
91212=Guam
89108=Henry (Antarctica)
Within the code, you will see the following:
if (preg_match('/91765|91375|91212|89108/',$GadgetExtremes[1][0])) {
$hiextremesLoc[1][0] = $hiextremesLoc[1][1];// Hi Temps-If first contains undesired location, skip to second
$hiextremesValue[1][0] = $hiextremesValue[1][1];
$loextremesLoc[1][0] = $loextremesLoc[1][1];// Lo Temps-If first contains undesired location, skip to second
$loextremesValue[1][0] = $loextremesValue[1][1];
}
// If first does not contain undesirec location, display normal
else {
$hiextremesLoc[1][0] = $hiextremesLoc[1][0];
$hiextremesValue[1][0] = $hiextremesValue[1][0];
$loextremesLoc[1][0] = $loextremesLoc[1][0];
$loextremesValue[1][0] = $loextremesValue[1][0];
}
Add, or delete the stations as needed and keep the syntax of the code intact separating with a pipe or “|”
Ya, but I have to be different! :lol: I have the UoM switching on the dashboard already, figured the menubar should do the same.
Works like a charm after I figured out you can only have one switcher on the whole page layout without breaking the javascript!! Just wrapped the html for the menubar in an ajaxdashboard
then the dashboard switcher controls the tags in the menubar also. Kinda cool!