12

New Weather Geeklets

Posted in Weather by roadglide03 1589 days ago

I updated the original scripts I posted. The weather site I was using made several changes that broke the script.

It gets information from yahoo.weather and the image from accuweather. You will need to change your info for your state and city.

The city name above the weather info is just plain text do no geeklet. Also if the weather info is blank then its probably due to being a sunny day. It wont show anything when everything is normal.

Must change your location.

Update: Updated weather info had some unwanted results.

Update #2: Update minor awk line in weather info. Update #3: Corrected test being shown for get image.


Comments

User Avatar
blikum 1574 days ago
Thanks for the update. I've changed the info on the geeklets to my own, but the weather icon will not change from the clouds no mater what the forecast is. Also, the weather image does not appear on it's own after a restart of the computer. I have to manually refresh to see it. Any ideas how to help? Thanks.
User Avatar
roadglide03 1574 days ago
Make sure your refresh is set right you want to import the image then display it.
User Avatar
Fanfulla 1567 days ago
Thanks man .... very nice ... just a little on the small image ;-)

i have this now ... is right?

if [ -f /tmp/weather4.png ];then

rm /tmp/weather4.png

fi

curl --silent http://www.accuweather.com/en/it/bologna/212979/weather-forecast/212979|grep Bologna|grep png|awk '{print $5}'|sed -e 's/icon://g'|sed -e 's/,//g'|xargs curl --silent -o /tmp/weather4.png

osascript -e 'tell application "GeekTool Helper"

refresh image geeklet "w_image"

end tell'
User Avatar
roadglide03 1566 days ago
If you want to change the size of the image then you need to modify the get image script it will look like this:

if [ -f /tmp/weather4.png ];then

rm /tmp/weather4.png

fi

curl --silent http://www.accuweather.com/en/us/hellertown-pa/18055/current-weather/340415|grep Hellertown|grep png|awk '{print $5}'|sed -e 's/icon://g'|sed -e 's/,//g'|xargs curl --silent -o /tmp/weather4.png

osascript -e 'tell application "GeekTool Helper"

refresh image geeklet "w_image"

end tell'

Just append the curl line with this and change the refresh of the image display script to a 60 or so:

; sips -Z 480 /tmp/weather4.png
User Avatar
Fanfulla 1565 days ago
# change this...

curl --silent -o /tmp/weather4.png

# to this?

; sips -Z 480 /tmp/weather4.png

# don't work this sips line
User Avatar
roadglide03 1564 days ago
It works but you have to adjust the timing of displaying the image I did 30 sec I think
User Avatar
BigBadBobD 1561 days ago
I really hate using yahoo for my weather, anyone have a script for the weather channel?
User Avatar
paradoxgrowth 1510 days ago
Hi great code, it is the only one I could get to work out of all the others. However, I can't seem to customize it for myself. I live in wichita ks, how can I get it to download my weather picture?

Here is what I did to change your code. Does it look right?

curl --silent http://www.accuweather.com/en/us/wichita-ks/67202/weather-forecast/348426|grep Wichita|grep png|awk '{print $5}'|sed -e 's/icon://g'|sed -e 's/,//g'|xargs curl --silent -o /tmp/weather4.png; sips -Z 480 /tmp/weather4.png >/dev/null

Thank you for your help!
User Avatar
BenRagunton 1173 days ago
Sadly I cannot seem to get this to work. I don't know if it's because of the update in Mac OS X, but it's just not working. All of the displays are blank, even after putting in the corrections that have already been suggested here.

Log in to comment or register here.