Hi just wanted to know if there is a way to use one's own weather icons with this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miaoulafrite’s picture

+1
icons are hardcoded in he module (line 158)

'icon' => theme('image', 'http://www.google.com' . $icon_src, $condition, $condition, NULL, FALSE),
miaoulafrite’s picture

@Road kill: did you find any way to change these images to custom ones without hacking the module?

vewakayeh’s picture

seems very easy to change weather icons

1. create a new dir inside the root dir (e.g. /var/www/html) mkdir -p ig/images/weather

2. copy the new images into this dir (22 GIF images acording to http://www.blindmotion.com/2009/03/google-weather-api-images/ )

3. change the url 'http://www.google.com' to your site url (e.g 'http://192.168.1.101') in line 158 and 181

press F5 :)

miaoulafrite’s picture

thanks vewakayeh

this is actually a hack of the module, or?

swafnir’s picture

as mentioned above, the icons have always been on www.google.com/....
but for some hours i am getting no icons any more, because the url now is the following:
http://g0.gstatic.com/images/icons/onebox/weather_rain-40.gif

that would be no big deal, just change the the url in google_weather.modulee as the 'http://www.google.com'-part is not needed any more, the new url is completely inside the $nextdays variable.

but as i am using custom icons anyway, i have got no idea, in what way i have to change my icon's filenames, because i cannot find a description/api for all the new weather-icon-names delivered by the xml.
maybe there are even some new icons there?

can anybody help me in this matter?

thanks ppl!

miaoulafrite’s picture

ah me too!

ian-moran’s picture

weather_thunderstorms-40.gif
weather_partlycloudy-40.gif
weather_sunny-40.gif

Only another 19 to go. I don't think the new icons are an improvement.

ian-moran’s picture

Here's some more

weather_overcast-40.gif
weather_partlycloudy-40.gif
weather_rain-40.gif
weather_scatteredthunderstorms-40.gif
weather_scatteredshowers-40.gif
weather_snowflurries-40.gif
weather_haze-40.gif
weather_smoke-40.gif
weather_fog-40.gif
weather_dust-40.gif
weather_icy-40.gif
weather_snow-40.gif
weather_sleet-40.gif
weather_cloudy-40.gif

swafnir’s picture

awesome!
thanks ian-moran
now my path-modification is working again. if i find further weather-file-names, i'll post them here :)

seun365’s picture

I am also using custom images and would really appreciate a listing of the names of the new images.

Thanks ian-moran for the listing so far.

seun365’s picture

i think there is a pattern, weather_(theweatherconditionname)-40.gif. Note the no space of theweatherconditionname, so even if the condition is more than a word, i think it should be joined together.

@Ian-moran, i think weather_cloudy-40.gif has been replaced by this weather_overcast-40.gif. hence duplication.

liminu’s picture

FileSize
2.45 KB

You only need to remove http://www.google.com from the .module (not for the api).
I attach th new .module working, simple replace it (do a backup)
If not work try #23 (http://drupal.org/node/1133362#comment-4559722)

swafnir’s picture

if you wanna work with custom icons and ignore the new name-conventions, you could also try to just use the $conditions to link it to your suiting custom icon.
http://www.tristarwebdesign.co.uk/blog/goodies/all-google-weather-api-co...
this guy found out all the possible conditions.

inwit’s picture

I found another icon in the wild:

weather_mostlycloudy-40.gif

Have you seen any other icons yet?

swafnir’s picture

no, unfortunately not.
we got 17 so far. if the total number of icons (it was 21) hasnt changed now, we are still missing 4.

nono29’s picture

@swafnir: no, the total number of icons was 22.

On my side, i've got 2 more:
weather_drizzle-40.gif
weather_windy-40.gif

but they were not in the old 22. So unfortunatly, google adds some new ones

swafnir’s picture

@nono29

i only knew about 21.
on this site http://www.blindmotion.com/2009/03/google-weather-api-images/ there are 22 lines, but chance_of_rain.gif is in the list double.
correct me, if i am still wrong ;)

thanks for the next two icons. bad news indeed, google adding new icons.
and i cant find any official API to their new weather-app, ffs.

nono29’s picture

oh ok sorry, you're right.

I've noticed that there's no equivalent for the moment, for 'chance_of_snow.gif', 'chance_of_storm.gif', 'chance_of_tstorm.gif' and 'chance_of_rain.gif' in the whole list we've made.
It looks like Google delete those ones -_-.

Otherwise, I've got a new one: weather_heavyrain-40.gif

nono29’s picture

And also: weather_heavysnow-40.gif

swafnir’s picture

i guess that
weather_scatteredthunderstorms-40.gif is the equivalent for chance_of_tstorm.gif
and
weather_scatteredshowers-40.gif is for chance_of_rain.gif

though i havent found any other scattered....40.gifs so far.

miaoulafrite’s picture

#12 is fine, please commit it to the next release

xeraseth’s picture

#12 did not work for me, my "current weather" icon div is blank (no image at all) and the weather forecast section is in Italian and the url for the images are just "http://mysite.com" with nothing after it

liminu’s picture

FileSize
14.15 KB

Try this one, i change only the .module

miaoulafrite’s picture

seems that icons did change again...

ian-moran’s picture

Just to annoy everyone it looks like Google have gone back to referencing the old images in the xml file, e.g. http://www.google.com/ig/images/weather/chance_of_rain.gif and not http://g0.gstatic.com/images/icons/onebox/weather_rain-40.gif. Therefore you will need to re-instate:

'icon' => theme('image', 'http://www.google.com' . $icon_src, $condition, $condition, NULL, FALSE), at line 157 and 'icon' => theme('image', 'http://www.google.com' . (string) $nextdays->icon->attributes()->data, $condition, $condition, NULL, FALSE),
at line 177 until Google decides to do something else.

If you are using custom icons you will need to go back to the old descriptions.

Anybody would think that Google aren't supporting this and they don't really want us to use it.

Nigelb’s picture

Thanks for all your hard work and advice on this... thought I was going mad when it wasn't working again! Ian's advice has restored the old icons for me (just as I was getting used to the new ones!). Thanks

liminu’s picture

I hope that Google will not change another time, the new icons were very pretty.

xeraseth’s picture

reinstalled the current version of the module and it is working again, wtf google

Road Kill’s picture

Hi Miaoulafrite no I have not attempted to change the icons yet but I will let you know if I have any joy.

markwk’s picture

It seems like custom icons should be a settings option for this kind of module.

jhuon’s picture

Second that. A settings option for custom icons would be really nice.

ckrina’s picture

I second that custom icons should be an option. I would like to help coding, but my knowledge is limited.
Until then, here is a small new icons list. I hope it helps:
cloudy.gif
chance_of_rain.gif
chance_of_snow.gif
dust.gif
fog.gif
haze.gif
icy.gif
mostly_cloudy.gif
mostly_sunny.gif
partly_cloudy.gif
rain.gif
showers.gif
sleet.gif
smoke.gif
snow.gif
storm.gif
sunny.gif
thunderstorm.gif