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

wild4life2013

macrumors newbie
Original poster
Mar 13, 2013
14
0
Shell weather.com image grab:
Code:
curl --silent "http://www.weather.com/weather/right-now/Ilfracombe+UKXX0565:1:UK" | grep -E -o 'http://s.imwx.com/v.20120328.084208/img/wxicon/120/.*png' | head -1 | xargs curl -o /tmp/weather.png

Image:
Code:
file://localhost/private/tmp/weather.png

Shell Current Weather Condition Weather.com:

Code:
curl --silent "http://www.weather.com/weather/right-now/Ilfracombe+UKXX0565:1:UK" |  grep --max-count=1 '<span class="wx-value" itemprop="weather-phrase">[^<]*</span>' | sed 's/<[^>]*>//g'

The Current condition and the weather image is not displaying. It has been working and for some reason today it has stopped working.

if any one has and ideas why it has stopped working or has working scripts that get the same information from weather.com

thanks in advance for any help
 
Last edited:
Try this, bro. It works to grab the weather conditions and icon from Yahoo Weather instead.

Weather Conditions:
Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX0565&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'

Image Grab:
Code:
curl --silent "http://weather.yahoo.com/united-kingdom/england/ilfracombe-24333/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\

Image:
Code:
file:///tmp/weather1.png
 
Bump...

Just setting up my desktop, which weather geeklet should I be applying this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.