You can customize the date format inside the the WeatherX.php script. Look for the variable $dateformat. Also, this grabs the timestamp from the server, so if you are located differently from your server, then the time/date will be a little off. On the next release I will allow for a parameter to set the date and the ability to offset the time for your locale.
Other than that, does all seem Ok?
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
Thanks for that I completely overlooked it. Everything seems fine.
Question - is there a way to parse the data at Wunderground and display a daytime/nighttime specific picture? I just checked Wunderground and it lists a picture specific for day/night.
Yeah, I thought I put that in the documentation somewhere. Right now the icon support for Wunderground is limited. Probably this Tuesday I will make it more full featured by checking the time and then giving the appropriate link, including Nighttime images.
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
I have added some Night time icon support. For better icon support for Wunderground, I need a list of all the phrases it returns for "Conditions:." Right now I have these:
- Overcast
- Clear
- Scattered Clouds
- Mostly Cloudy
- Heavy Rain
- Light Rain
Finally, this newest version can be found at the first post, but also in the repository, where all future updates will be stored.
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
I see this thread hasn’t been active for a few years - is the snippet still supposed to work with MODx (1.0.3)?
I don’t get it to work, and the install instructions are a bit fuzzy, so I would just like to check a few things:
The snippet is called WeatherX, and then you create a chunk which can be called anything you like, with the following bit of code in it (for Wunderground):
[!weather?&zipcode=`90001`&units=`metric`&offSet=`2`&nightTime=`19`!]
<div>
<p>Temp: [+wxTemp+]</p>
<p>Wind: [+wxWindDir+] @ [+wxWindSpeed+]</p>
<p>Conditions: [+wxConditions+]</p>
<p>Pressure: [+wxPressure+]</p>
<p>Humidity: [+wxHumidity+]</p>
<img src="[+wxIcon+]">
</div>
Is it correct that the snippet call is "weather", even though the name of the snippet is WeatherX? (On a differnt note, wouldn’t it make more sense to have the HTML code and variables in a chunk that’s defined by something like &tpl?)
Apart from creating the chunk and the snippet in Manager you also need to upload the files weather.txt and WeatherX.php to snippets/WeatherX, and upload the PNGs stored in "weather" into a folder called "graphics", right?
Is that it? I don’t get any data whatsoever - where could I be going wrong...?
I’m planning to use the snippet for Swedish weather, but thought I should start by getting it to work with the default US zip code.