Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alfredlgj

macrumors newbie
Original poster
Nov 1, 2011
5
0
I need some help here as the shell my Geektool shell for yahoo weather images seem not to be working. I have been using this and it works fine until recent weeks. And I haven't changed it recently (or at least i think i didnt)

Shell:

curl --silent "http://hk.weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather1.png\

Image:

file:///tmp/weather1.png

Any insight?
 
If you check out here https://forums.macrumors.com/threads/628023/ you'll see yahoo made some changes, so that you can no longer get the images. In that thread, there is the ultimate weather package made by xtacocorex. There are examples of how to run the scripts and also getting weather from various sites besides yahoo with images.
 
Last edited:
Oh thank you!

That seems to work but the images seem to be crappy.
The .gif image from yahoo was way worse then the original one. Doesnt even have a transparent background.
Is that supposed to be so?
 
I need some help here as the shell my Geektool shell for yahoo weather images seem not to be working. I have been using this and it works fine until recent weeks. And I haven't changed it recently (or at least i think i didnt)

Shell:

curl --silent "http://hk.weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather1.png\

Image:

file:///tmp/weather1.png

Any insight?

Here:
curl --silent "http://weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\
 
Here:
curl --silent "http://weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\



could you please change my url too?

curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-735160/?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

thanks a lot
 
could you please change my url too?

curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-735160/?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

thanks a lot

All you have to do is go to Yahoo! Weather, type in your location and copy the url in the address bar of your browser and replace the url in the curl command.
 
i have tried it,

curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-12852803//?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

this is the new code, but it still doesn't work. am I missing something?

thanks for your reply
 
i have tried it,

curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-12852803//?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

this is the new code, but it still doesn't work. am I missing something?

thanks for your reply


I changed how the location was coded before to how Yahoo! is coding it now.

Try this....

Replace what is in red

curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-12852803//?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

With this

?w=12852803/

After I made this change the image popped back up after a minute.
 
I changed how the location was coded before to how Yahoo! is coding it now.

Try this....

Replace what is in red

curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-12852803//?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

With this

?w=12852803/

After I made this change the image popped back up after a minute.

Is this correct?

curl --silent "http://weather.yahoo.com/?w=12852803/" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

I still don't have the image back
 
Is this correct?

curl --silent "http://weather.yahoo.com/?w=12852803/" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

I still don't have the image back


If 12852803 is the code for your city then it should work. As soon as I changed mine I got my image back. I had to restart earlier today for something else and it took about 5 minutes for it to pop back up. So I imagine its still finicky.
 
If 12852803 is the code for your city then it should work. As soon as I changed mine I got my image back. I had to restart earlier today for something else and it took about 5 minutes for it to pop back up. So I imagine its still finicky.


12852803 is correct I checked it again, but still nothing, the computer is on for a few hours and it hasn't showed.
 
It's finally working, the problem was in the image path

thanks for the help all
 
It's finally working, the problem was in the image path

thanks for the help all

Would you mind pasting your final code? I've tried a few combinations of the suggestions here, but still can't seem to get it to work. I've triple-checked my image path--but no luck. Thanks in advance.
 
Hello,
Yahoo changed source... Picture doesn't work anymore. Any suggestions for new code? :(
 
Hello,
Yahoo changed source... Picture doesn't work anymore. Any suggestions for new code? :(

I made one! It gets the icon from weather.com.

curl --silent "http://www.weather.com/weather/right-now/ZIPCODE" | grep -E -o 'http://s.imwx.com/v.20120328.084208//img/wxicon/120/.*png' | head -1 | xargs curl -o /tmp/weather.png

Replace ZIPCODE with your zip code. You can also look up your town on weather.com and paste the url in.

In geektool, make that a shell geeklet and make another image geeklet with the url "file://localhost/private/tmp/weather.png"

Hope it works.

Edit: I also made something to get the numerical temperature off of weather.com:

curl --silent "http://www.weather.com/weather/right-now/ZIPCODE" | grep -E -o 'itemprop="temperature-fahrenheit">[0-9]*' | head -1 | awk -F'>' '{print $2;}'
 
Last edited:
the weather image from weather .com

the weather image from weather.com is no longer working
please can you look into it and email me wild4lifedesigns @ live dot co dot uk
thanx for your help.

I cant find any other decent weather image scripts as yahoo weather is rubbish
 
Here:
curl --silent "http://weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\

After working for half a year, it has stopped working again
Help, Ivan!
 
I cannot get the weather image to show. I can get the forecast and the temp but have not had any luck with an image. Any help would be greatly appreciated :)
 
Yahoo weather icon working in Maveriks

Hi mates: After working two weeks finally I set up new scrips working with the nice yahoo icons.

1. Open geek tools

2. WEATHER IMAGE SCRIPT (image)
file://localhost/tmp/weatherYfr.png

Refresh every 30 seconds


3. go to www.fr.meteo.yahoo.com set your city (for me is Barcelona, Spain) and copy your url:

[COLOR="Blue"][COLOR="Blue"]http://...orks fine for me in Mavericks. LOL. BIG_JM
 
this working for me

where the fr.meteo.yahoo URL is obtained from fr.meteo.yahoo.com:

Code:
curl -s https://fr.meteo.yahoo.com/états-unis/michigan/ann-arbor-2354842/ | grep ‘obs-current-weather’ | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl -s -o /tmp/weather.png
 
Yahoo alternatives?

Hi all,

A lot of people seem to have had trouble with the images from Yahoo weather so I was wondering whether it was possible to write a script to get the info from another website.

The BBC weather page has some really nice, simple images (for those of us who like minimalist icons). I don't know very much about coding at all (the best I've been able to do is tweak other people's scripts to change values like size, color etc.) but it seems no one has tried to create a geeklet with images using the BBC page. Some people have gotten weather conditions in written form from the BBC's Conditions RSS feed, but then how does one go about getting the weather images? Is it possible to tweak the Yahoo geeklet script to use another page? Help please!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.