ExpressionEngine 7.5 has been Released! Learn More!
We have been having unusual weather here in Sitka Alaska this week and it got me to be thinking about a weather plugin.
I took a look at the available PHP scripts that deliver the weather however none of them were easily convertible to EE as a plugin and none of them had quite the functionality that I think would make a great plugin.
First I think it would be great to have it allow you to specify a certain day. For instance if I wanted the weather for a few days ago I could put that info as a parameter into the tag for the plugin and it would provide the weather for that day instead of what would probably be the generic display of the weather for whatever day it happens to be. It would also be useful to have parameters for what content to display, IE temp, wind direction, humidity, graphic, etc.
I sadly don’t have the skill to do this from scratch. Anyone interested in the challenge? I would love to help in anyway possible be it graphics, or testing, but I wouldn’t be much help with the coding.
Anyone else interested in something like this?
Jamie
Really? I was assuming they did allow that since you can do it through a search. Well I dug through one a script that uses weather.com and found this xml feed:
http://xoap.weather.com/weather/local/99835?cc=*&link=xoap&unit=s&prod=xoap&par=1003524002&key=6196f50b8fb87a21
cc means current conditions I think. I suppose we would have to see if there is a way to ask for pc or previous conditions or something like that. 😊
Another choice at least for the US would be NOAA. I’m checking their page right now. I know other scripts have used them for a source before however I’m not seeing any feeds.
Jamie
methnen, from what I seen so far weather.com only allows you to obtain future weather information for up to 10 days. I’m working on a plugin using their feed since it supports other locations… including cities in Canada. I’ll try and finish it by the end of the week, hopefully that is.
There’s also http://www.rssweather.com. I use that to get weather for Canada. 😊
I have used weather pixie - it’s good for around the world but it doesn’t do future days only current weather.
Anyone what to test it out for me? Might be contain a bug or two, but should work as expected over all. Comments and improvement suggestions are welcomed.
redo, works just fine on my 1.1beta test site.
I’ve lots of cloud pictures.. I might add an if statement to show various photos depending on the cloud conditions.
Suggestion: rename the readme.txt to readme_worldweather.txt, so when I unzip the file, I don’t have to worry about over writing another readme.txt.
Do you have any idea what the various sky conditions are?
Yes, if you take a look at the lang.world_weather.php in a text editor it should be everything listed under the heading titled “Skys”…
The default values are clear skies, partly cloudy, scattered clouds, clear below 12,000 ft, mostly cloudy, overcast, and obscured but they can be changed to anything you want in the control panel.
I also changed the name of the readme file as you suggested.
I did see those in the lang file..
But –
//----------------------------
// Skys
//----------------------------
"SKC" =>
"clear skies",
"NSC" =>
"clear skies",
"SCT" =>
"partly cloudy",
"SKT" =>
"partly cloudy",
"FEW" =>
"scattered clouds",
"CLR" =>
"clear below 12,000 ft",
"BKN" =>
"mostly cloudy",
"OVC" =>
"overcast",
"VV" =>
"obscured",
"CB" =>
"cumulonimbus",
"TCU" =>
"towering_cumulus",
See how you have dupes there? 2 clear skies and 2 partly cloudies.
Or are there more than one possibilites for these?
Sorry to get so detailed - but it’s the certification analyst in me.
There’s only one possibility for those fields. The weather data that the plugin receive’s (called a Metar) is encode and has to be decode. Here’s and example of what’s received…
2004/08/09 10:30
EIDW 0900Z 24035G55KT 210V270 1700 +SHRA BKN007 OVC015CB 08/07 TEMPO 3500
For example “OVC015CB” means… Overcast (solid cloud cover) 15000 feet high and the cloud type is cumulonimbus.
There are duplicates because a particular value may be coded in more than one way depending on the station or if the station’s is in the US or Europe. Clear skies may encoded as SKC or NSC in the metar.I duplicate used values so that if it came up as NSC or SKC EE would fetch the value of clear skies with out me having to add extra coding to use a single value for both. I didn’t think about it being confusing though and change this.
Just realized that I spelled skies wrong 😊
“clear_skies” => “clear skies”,
“partly_cloudy” => “partly cloudy”,
“scattered_clouds” => “scattered clouds”,
“clear_below_twelve_thousand_feet” => “clear below 12,000 ft”,
“mostly_cloudy” => “mostly cloudy”,
“overcast” => “overcast”,
“obscured” => “obscured”,
“cumulonimbus” => “cumulonimbus”,
“towering_cumulus” => “towering cumulus”,
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.