181

For some reason all the other geeklets that claim to display the weather and weather icon on your desktop never worked for me. After some searching I finally found this. It isn't my work, I'm just sharing.

First download "Weather (info)" and add it as a shell. This command retrieves the weather icon from Yahoo! and stores it as a temporary file on your computer. I set the refresh rate to 300 seconds (5 minutes) because I didn't want it constantly looking online for new icons. NOTE: THE ICON WILL NOT SHOW UP ONCE YOU SET UP THIS SHELL, HOWEVER IT MUST REMAIN ON YOUR DESKTOP OR ELSE THE NEXT STEP WON'T WORK.

Second, download "Weather (image)" and add it as an image. This command will take the temporary image you downloaded using the shell from step one, and display it as an image on your desktop. Again, I set the refresh rate to 300 seconds.

Finally, download the "Weather (description)" file and add it as a shell. This will add a short description of the current weather outside (such as "Partly Cloudy, 67F"). I also used 300 seconds as my refresh rate and you can edit the font, size and color as you see fit.

NOTE: The files are configured to retreive the weather for Storrs, CT. To change the weather for your town, you must follow a couple steps.

  1. First, to change the weather icon, simply go to Yahoo! Weather and go to the main weather page for your area. Copy the URL and paste it in the shell command area, (from Weather (info)) replacing the URL for Storrs, CT (http://weather.yahoo.com/united-states/connecticut/storrs-12760328/)

  2. Second, to change the weather description, you must click the "RSS" button on the same weather page you were just on. It's located near the top right of the page and is in orange. It will bring you to another page where you can copy the URL and paste it over the shell for "Weather (description)", replacing the information for Storrs, CT (http://weather.yahooapis.com/forecastrss?p=USCT0222&u=f).

After both of these steps you should be all set.

One final thing, when you first start up your computer or first install these shells, the icons or information may not appear right away. Simply click on the GeekTool icon in the menu bar and click "refresh all".

This is what my desktop looks like

Comments

User Avatar
watchdog 1278 days ago
I did all of the setup steps in your guide, but since I entered my weather address in the script everything is empty except the weather icon. BTW the RSS feed is in another format, I don't know if this changes anything in your Weather Description script. (ie. for Thessaloniki-Greece feed://weather.yahooapis.com/forecastrss?p=GRXX0019&u=c) Actually, I tested it right now with Fahrenheit instead of Celcius and it worked. I mentioned this in case this helps you with the script.
User Avatar
clownie305 826 days ago
Not working for me!!!!! Did I doing wrong?

curl --silent "http://weather.yahoo.com/united-states/florida/miami-FLXXXX2/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

curl --silent "http://weather.yahooapis.com/forecastrss?p= FLXXXX2&=f" | grep -E '(Current Conditions:|F
User Avatar
watchdog 1278 days ago
Sorry for spamming, but I solved it and I'm replying to myself in order to help others with this.

So, in case you want to have Celsius instead of Fahrenheit you need to edit a little bit the code.

Go to "Command" and this is what you  get:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USCT0222&u=f" | grep -E '(Current Conditions:|F
User Avatar
tranquilamongstchaos 1250 days ago
I am having trouble transitioning the icon to the weather in my area. Anyone figure out how to fix theirs?
User Avatar
adamcole83 1246 days ago
Yeah I can't get my weather icon to work in my area either.  It stays on rainy all the time.
User Avatar
tneil27 1238 days ago
For some reason I can get the icon to work but when I put in the URL for my area the description dissapears.  Any suggestions?
User Avatar
flightmaniac 1238 days ago
For those that can't get the description to work, the solution is to make sure that when you copy the RSS address, you need to put http:// at the start of the URL in place of the feed://.  It will then work perfectly!
User Avatar
spomelete 1189 days ago
I Got it working great and I also got it working with C˚ instead of F˚. So Thank you so much. But please tell me where you got your desktop picture and if you have it in good quality?
User Avatar
andresitotubia 1096 days ago
Take a look. I had the same problem.

Do you have to change the f in this line too and it's going to work

"http://weather.yahooapis.com/forecastrss?p=USCT0222&u=c"
User Avatar
Stevo 1187 days ago
I can't get the C˚ working have tried all suggestions. Any ideas, current code below.

curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX0022&u=C" | grep -E '(Current Conditions:|C
User Avatar
jstrause 1148 days ago
This was great, worked perfectly.  Can you tell me how i would include the two lines of "Forecasts" from the RSS page beneath your "Current Conditions" with a line-space beneath or a as a separate shell? Thanks.
User Avatar
Lita 1129 days ago
Works great :) , thank you
User Avatar
sctman 1105 days ago
I can't get this to work. Very frustrating. I'm new. In step 1, Wx info "add it as a shell". How do I "add it as a shell"? Do I double click the Wx info .glet file? this pops up a Geekltool window asking if I want to run it. If I click yes, nothing new displays in Geektool 'ver 3.0.1'. No properties window for the 'info' file. If I double click the other 2 files, their property windows show up in Geektool.
User Avatar
ramard 1099 days ago
sctman, minimize all the windows and use a white or "lightly" wallpaper, once you do that, you will see the shells, images and commands geeklets once you open it, and click yes.

Hope, this help.

Cya
User Avatar
Cantello 1104 days ago
Works greast, thanks a lot! :-)

Two questions: How to add the degree symbol (°) before the temperature unit? And, as one person before asked, how to include the short forecast that Yahoo gives us?

@sctman: Somewhere on your desktop, the empty geeklet container will show up. If not, try deleting and re-adding it (if not possible otherwise, go to ~/Library/Preferences/org.tynsoe.geeklet.shell.plist, open with the property editor and delete as fit).
User Avatar
Klutch_bl3ndz 1100 days ago
doesn't seem to work for me
User Avatar
olivierdeen 1097 days ago
Works perfect!!! Nice, keep going!
User Avatar
bshrode 1094 days ago
Try this:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USFL0378&u=f" | grep -E '(Current Conditions:|F//g' -e 's/ F$/˚F/'
User Avatar
jynxx 871 days ago
tried ur code to get the degree symbol, but didn't werk for me. still having problems with the description overall---just to get it to show the correct description. it is stuck on "partly cloudy, 45 F"
User Avatar
britainyk 1091 days ago
great! TFS
User Avatar
subhash428 1091 days ago
hello guyyss...i'm the new user for geeltool.don't know how to use it. is there any video tutorials.........
User Avatar
albert2172 1088 days ago
This is working great for me but is there anyway that i can put two weather locations..??

Because i want it to keep me updated with two different weather locations but when i add everything it works great the only thing that i can't fix is the weather image. The weather image stays the same for both and when i click refresh it changes to the other weather location.

Basically both of the weather image stay the same. (and they are not)

Please help me I want to get this thing to work!!
User Avatar
albert2172 1088 days ago
Okay i think i got this to work.

All i did was change the //tmp/weather.img

to //tmp/weather2.img. :)

so now one of my weather locations uses weather.img

and the other uses weather2.img

*note i changed this for both the weather(img) and weather (description) ;)

Hope i got it right and helps someone :)
User Avatar
subhash428 1068 days ago
problem with weather icon of yahoo ....first i had set yahoo icon. it worked for sometime but after that the icon disappeared . from that time i tried a lot but failed to set. any perfect solution ???
User Avatar
subhash428 1065 days ago
it had worked in the very beginning but after that it won't appear. basically i seek with weather icon. weather description is working great !!!! only problem with weather icon....please guyyyss.........find some solution...!!!
User Avatar
subhash428 1065 days ago
Try this,who has problem with F to C as:

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=chxx0037&u=c" | grep -E '(Current Conditions:|C
User Avatar
nicasiolacroze 1027 days ago
thanks..now works
User Avatar
Fleek 1012 days ago
Edit: Fixed.
User Avatar
eeverett2 1000 days ago
Is there any way to get the ° sign on the description?
User Avatar
nolook 997 days ago
(NOTE: I can't get code blocking to work correctly in these comments, so please replace all instances of "&lt" with the "less than" symbol)

I modified the Weather (description) to:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USCA1239&u=f" | grep -E '(Current Conditions:|F&ltBR|High:)' | sed -e 's/Current Conditions://' -e 's/&ltbr \/>//' -e 's/&ltb>//' -e 's/&lt\/b>//' -e 's/\ F&ltBR \/>/° F/' -e 's/&ltdescription>//' -e 's/&lt\/description>//'

This gave me a ° symbol, and showed me the two day forecast (which do not have the ° symbol). It's not a perfect solution, but should work for those using celsius if it's modified to:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USCA1239&u=c" | grep -E '(Current Conditions:|C&ltBR|High:)' | sed -e 's/Current Conditions://' -e 's/&ltbr \/>//' -e 's/&ltb>//' -e 's/&lt\/b>//' -e 's/\ C&ltBR \/>/° C/' -e 's/&ltdescription>//' -e 's/&lt\/description>//'

Hope this helps.
User Avatar
mrbeast87 988 days ago
Wow, this geeklet is superb!

But does anyone know how can I make it for tomorrow, instead of today's weather? It would be much more useful.
User Avatar
JasonFromOhio 970 days ago
awesome
User Avatar
barndoor0311 943 days ago
Very Useful, Thank You
User Avatar
Kj820 935 days ago
Works perfectly. Had to change the units to celsius, followed the comments above. Thanks a bunch!
User Avatar
nervouschicken 919 days ago
Very sleek, nice job!
User Avatar
kiari24 919 days ago
Works great! Thank you :)
User Avatar
gravityedge 916 days ago
Very nice! Thank you very much indeed!
User Avatar
baker0408 879 days ago
I have the description working great, but I restarted my computer and can't get the image to appear. Any thoughts?
User Avatar
jynxx 871 days ago
same thing happened to me, then i noticed that the "automatically launch at login" check box was not checked for that geek let
User Avatar
jynxx 871 days ago
ok, got the description to were, looks like a didn't do step 2 right
User Avatar
jbc 867 days ago
How do I add windspeed?
User Avatar
maybeapreacher 865 days ago
Hi,

thanks for this geeklets ;-) I used it to build my own setup with other scripts together.

But as of today the script won't download an image anymore. Somehow it is broken, as yahoo changed their website and thus the "forecast-icon" section is not on the website anymore.

Any help for changes to the script?

This is my code:

curl --silent "http://weather.yahoo.com/germany/hesse/frankfurt-650272/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\
User Avatar
gustao 864 days ago
@maybeapreacher: i noticed it yesterday... I even tried to fix the code, but unfortunately I couldnt.
User Avatar
kronos27 864 days ago
@maybeapreacher & gustao

I futz'ed with the code a little and got it to work using this:

curl --silent "http://weather.yahoo.com/germany/hesse/frankfurt-650272/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather.png\

I don't pretend to know sed and it took a lot of trial and error but it seems to do the trick. Then again, it's late afternoon and may break tomorrow, but for now it works. Enjoy!
User Avatar
gustao 864 days ago
thank you!
User Avatar
maybeapreacher 863 days ago
thanks a lot!
User Avatar
gustao 864 days ago
yahoo mysteriously returned to the old interface!
User Avatar
pstarsr 862 days ago
yea i couldn't gewt the new codes working. tried the original. and worked fine. weird
User Avatar
gustao 838 days ago
yeah, we return to the previous problem.. yahoo adopted the new layout again.

Just use the @kronos27 code (above) to get it work again
User Avatar
kodokmabox 836 days ago
i cant find the RSS button.
User Avatar
gustao 816 days ago
@kodomabox,

as we can see in the yahoo weather API Documentation, you can change the url link to get the rss feed informations.

instead the author suggestion: http://weather.yahooapis.com/forecastrss?p=**USCT0222**&u=f

get the number in the new link format: http://weather.yahoo.com/united-states/connecticut/storrs-**2500574**/

and use in the rss url, with the new "**w**" variable: http://weather.yahooapis.com/forecastrss?**w=2500574**&u=f

ps: disregard the "**"... markdown formatting is not working..
User Avatar
mdjanes 833 days ago
The "weather (image)1" for the yahoo icon no longer works (yahoo must have changed their website). You can use the following command to get the image:

curl --silent "http://weather.yahoo.com/united-states/new-mexico/albuquerque-12794959/" | grep "current-weather\" style=\"background" | sed "s/.*background\:url(\'\(.*\)\') no.*\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png

again, you have to change the location.
User Avatar
c45p31 714 days ago
looks great
User Avatar
hernanchodiaz 693 days ago
beauty
User Avatar
Fleek 674 days ago
Since the RSS button is no longer available on Yahoo (or if it is I can't find it!), you can go to: http://www.weather.com/weather/rss/subscription/

From here put in your city in the search box under where it says "local weather" and hit search.

Look at your URL, your city code is at the end of the URL. From here copy and paste your city code into the URL in the geeklet where it says to put in your city code.

Hope this helps
User Avatar
Alienraygun 646 days ago
for the Weather(info).glet the first part of the shell script

curl --silent "http://weather.yahooapis.com/forecastrss?w=**locationcode**&u=f" | grep -E '(Current Conditions:|F>BR)'

results in ****Current Conditions: **** ****

Adding this

| sed "s/.*background\:url(\'\(.*\)\') no.*\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png

just strips out the Current Conditions: and leaves the html tags

#Edit# My solution below
User Avatar
Alienraygun 646 days ago
I gave myself a little education on shell scripting and investigated what exactly was coming from the Yahoo RSS feed. I discovered, what I think, is an easier way to scrape the info I want.

First, I found this line before the weather info displayed in the RSS: <yweather:condition text="Fair" code="33" temp="36" date="Sat, 24 Nov 2012 5:53 pm EST" />

It had all the info I needed. So after some research into grep, awk and see, I came up with this shell script:

curl --silent "http://weather.yahooapis.com/forecastrss?w=12769887&u=f" | grep -A1 "yweather:condition" | awk '{ printf $4 $2 }' | sed -e 's/"//g' -e 's/=//g' -e 's/temp//g' -e 's/text/º /g'

Basically I used grep to grab the line I wanted, awk to grab the two fields I was after and sed to strip out the extraneous characters and add a degree symbol (option 0) and space behind the temperature.

There are <yweather:forecast lines in the RSS as well. I could see using similar methods to scrape forecast information as well.
User Avatar
Alienraygun 646 days ago
Well I have found a better solution but apparently my explanation of the solution is considered spam. So I'll keep it to myself since I have no idea what words are considered spam.
User Avatar
imfloflo 204 days ago
you can use this instead

curl --silent "http://weather.yahooapis.com/forecastrss?w=589325" | grep -E 'l.yimg.com/a/i/us/we/52/.*gif' | head -1 | cut -f 2 -d '"' | xargs curl -o /tmp/weather.png

or this one

curl --silent "http://www.weather.com/weather/today/FRAU0216" | grep -E '/img/wxicon/120/.*png' | head -1 | cut -f 2 -d '"' | xargs curl -o /tmp/weather.png

both working
User Avatar
roadglide03 193 days ago
Made some tweaks to get rid of the :

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USPA0701&u=f" | grep -E '(Current Conditions:|C
User Avatar
roadglide03 192 days ago
Made some tweak the editing on my reply is messing it up so resubmitting here:

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USPA0701&u=f" | grep -E '(Current Conditions:|C
User Avatar
papiesz 182 days ago
new load

1. picture from accuweather instead of graphic from weather.com, its bigger either

curl --silent "http://www.accuweather.com/en/us/new-york-ny/10007/weather-forecast/349727" | grep -o 'http://vortex.accuweather.com/adc2010/images/icons-numbered/[0-9][0-9]-xl.png' | xargs curl -o /tmp/weather.png

2. less grep for temperature:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USNY0996&u=f" | grep "[0-9] F" | cut -d '
User Avatar
papiesz 182 days ago
celsius too, but without conditions:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USNY0996&u=c" | grep "[0-9] C" | cut -d '
User Avatar
papiesz 182 days ago
3. humidity:

curl --silent "http://weather.yahooapis.com/forecastrss?p=USNY0996&u=f" | grep 'humidity' | cut -d '"' -f 2 | sed "s/$/%/"

looks like that:

http://i.imgur.com/imfDqRL.png

dunno why had to write three posts, antispam sucks
User Avatar
BIG_JM 166 days ago
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:

http://fr.meteo.yahoo.com/espagne/catalogne/barcelone-753692

4. IMAGE GRAB SCRIPT (Shell)

###

curl --silent "http://fr.meteo.yahoo.com/espagne/catalogne/barcelone-753692" | grep "url('http://l.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\ NEW

Replace NEW with:

< d i v.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\

(eliminate spaces in d i v)

###

Refresh every 30 seconds

Works fine for me in Mavericks.

LOL. BIG_JM
User Avatar
BIG_JM 166 days ago
Sorry the last post is cut there Image Grag Scrip.

4. IMAGE GRAB SCRIPT (Shell)

sed -e "s/\

Log in to comment or register here.