Firstly, Thanks for a great module :)
This is sort of a mixed feature request and possibly a bug report...
I've been using it for a few days now on a site I'm developing for an R/C model flying club in the UK...I've just ran into a few problems where it has displayed daytime images during the night which seemed to fix themselves after it turned midnight here. This lead me to go and take a look at the Yahoo Weather site and drill down to my location to see if there was a problem on the site - all was well BUT I did notice that the along with the wind speed, the Yahoo info box was showing the wind DIRECTION as well. Is it at all possible to add this feature as it could prove invaluable to our members to know if the direction is favorable?
Many thanks :)
Comments
Comment #1
Pedro Lozano commentedThe day/night status is returned by yahoo, but maybe you have found some timezone issue, we will look into it.
I leave the issue open in case we have some time to implement the wind direction among other pending feature requests.
Comment #2
axel pressbutton commentedMany thanks for your reply Pedro.
I will keep an eye on the day/night issue from my end and see if i can provide any more details on the exact times the issues occur. I'm wondering if it has anything to do with daylight saving hours etc. It's almost midnight here in the UK and I currently have 'day-overcast-fog-light-rain.png' showing...I have a feeling this may change to a correct night time version when cron runs again after midnight.
Thanks for leaving this issue open so that I can follow any progress on the wind direction feature :)
Comment #3
axel pressbutton commentedJust a quick update:
I ran cron manually as soon as it hit midnight and the image changed to night-overcast-fog-light-rain.png
cron had ran about 5-10 minutes before and it was still showing the day version then.
The city code I am using is for Bath, UK - UKXX0012
Comment #4
axel pressbutton commentedHi Pedro,
Just an update on this - I actually managed to get the wind direction to show, I'll post the code in a minute...the trouble is, I noticed that just before carrying out the latest dev update the wind direction was no longer showing :(
I carried out the update and added my code again, it still didn't work. Well, that's not strictly true...I can get it to display the wind direction in degrees but appear to now be able to convert it.
The code I added was as follows (which used to work, and not quite sure when it stopped);
yahoo_weather_forecast.module
yahoo-weather-forecast-content.tpl.php
If I add...
print $wind_directionit will display the wind direction...proving that the data is being pulled in. Do you have any suggestions as to why this may not be working now?
Thanks again :)
Comment #5
axel pressbutton commented*sigh* OK, it looks as though there's a problem with the code I've used to display the wind direction when it's coming from the North!
The wind has changed now to NNW and it is displaying OK - does this mean that my array needs to have N at the start and then repeated at the end or is it more complicated than that?
Note: When the problem occured the wind direction was 350 degrees
Comment #6
Pedro Lozano commentedThe code is OK except for the $compass array, it should be:
Note the 'N' at the end.
When the wind direction is near 360 it didn't get a corresponding value in the array.
I also relocated the code to the preprocess function, leaving only the print $wind_direction in the template file.
Thanks for you code. I commited this to the development version and will create a new release soon.