If anyone is interested this is the script I use for my weather, its a collection of stuff I have found lying around (just change your yahoo location code):
property white_space : {space, tab, return, (ASCII character 10), (ASCII character 13)}
on run
set pathName to "/Users/xxx/Documents/Settings/WeatherIcon"
set weatherFile to pathName & "/WeatherIcon.txt"
set weatherLocation to "xxxxxx"
set tempType to "c" -- "f" for Fahrenheit and "c" for Celsius
must be lowercase
set newline to "\\\\n"
set degreesF to "F"
set degreesC to "C"
set degrees to ""
if tempType is equal to "f" then
set degrees to degreesF
else if tempType is equal to "c" then
set degrees to degreesC
end if
set weatherCurl to (do shell script "curl --silent 'http://xml.weather.yahoo.com/forecastrss/" & weatherLocation & "_" & tempType & ".xml' | grep 'yweather:' >" & weatherFile)
--set weatherCurl to (do shell script "curl --silent 'http://weather.yahooapis.com/forecastrss?p=" & weatherLocation & "&u=f' | grep 'yweather:' >" & weatherFile)
set forecast1Day to "Today"
set forecast2Day to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==2{print;exit}' | sed -e 's/.*day=//;s/date=.*//' | sed 's/\"//g'") as string
set forecast2Day to (my trim_string(forecast2Day, white_space, "both"))
set forecast3Day to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==3{print;exit}' | sed -e 's/.*day=//;s/date=.*//' | sed 's/\"//g'") as string
set forecast3Day to (my trim_string(forecast3Day, white_space, "both"))
set forecast1Conditions to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==1{print;exit}' | sed -e 's/.*text=//;s/code=.*//' | sed 's/\"//g'") as string
set forecast1Conditions to (my trim_string(forecast1Conditions, white_space, "both"))
set forecast2Conditions to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==2{print;exit}' | sed -e 's/.*text=//;s/code=.*//' | sed 's/\"//g'") as string
set forecast2Conditions to (my trim_string(forecast2Conditions, white_space, "both"))
set forecast3Conditions to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==3{print;exit}' | sed -e 's/.*text=//;s/code=.*//' | sed 's/\"//g'") as string
set forecast3Conditions to (my trim_string(forecast3Conditions, white_space, "both"))
set forecast1High to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==1{print;exit}' | sed -e 's/.*high=//;s/text=.*//' | sed 's/\"//g'") as string
set forecast1High to (my trim_string(forecast1High, white_space, "both"))
set forecast2High to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==2{print;exit}' | sed -e 's/.*high=//;s/text=.*//' | sed 's/\"//g'") as string
set forecast2High to (my trim_string(forecast2High, white_space, "both"))
set forecast3High to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==3{print;exit}' | sed -e 's/.*high=//;s/text=.*//' | sed 's/\"//g'") as string
set forecast3High to (my trim_string(forecast3High, white_space, "both"))
set forecast1Low to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==1{print;exit}' | sed -e 's/.*low=//;s/high=.*//' | sed 's/\"//g'") as string
set forecast1Low to (my trim_string(forecast1Low, white_space, "both"))
set forecast2Low to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==2{print;exit}' | sed -e 's/.*low=//;s/high=.*//' | sed 's/\"//g'") as string
set forecast2Low to (my trim_string(forecast2Low, white_space, "both"))
set forecast3Low to (do shell script "awk '/yweather:forecast/{print $0}' " & weatherFile & "| awk 'NR==3{print;exit}' | sed -e 's/.*low=//;s/high=.*//' | sed 's/\"//g'") as string
set forecast3Low to (my trim_string(forecast3Low, white_space, "both"))
--set forecastDay1 to forecast1Day & ": " & forecast1Conditions & ", " & forecast1High & degrees & " Low: " & forecast1Low & degrees
--set forecastDay2 to forecast2Day & ": " & forecast2Conditions & ", " & forecast2High & degrees & " Low: " & forecast2Low & degrees
--set forecastDay3 to forecast3Day & ": " & forecast3Conditions & ", " & forecast3High & degrees & " Low: " & forecast3Low & degrees
set forecastDay1 to forecast1Day & ": " & forecast1Conditions & ", " & forecast1High & degrees
set forecastDay2 to forecast2Day & ": " & forecast2Conditions & ", " & forecast2High & degrees
set forecastDay3 to forecast3Day & ": " & forecast3Conditions & ", " & forecast3High & degrees
set distance to (do shell script "grep -E 'yweather:units' " & weatherFile & "| sed -e 's/.*distance=//;s/pressure=.*//' | sed 's/\"//g'") as string
set distance to (my trim_string(distance, white_space, "both"))
set speed to (do shell script "grep -E 'yweather:units' " & weatherFile & "| sed -e 's/.*speed=//;s/\\/>.*//' | sed 's/\"//g'") as string
set speed to (my trim_string(speed, white_space, "both"))
set weatherCondition to (do shell script "grep -E 'yweather:condition' " & weatherFile & "| sed -e 's/.*text=//;s/code=.*//' | sed 's/\"//g'") as string
set weatherCondition to (my trim_string(weatherCondition, white_space, "both"))
set weatherTemp to (do shell script "grep -E 'yweather:condition' " & weatherFile & "| sed -e 's/.*temp=//;s/date=.*//' | sed 's/\"//g'") as string
set weatherTemp to (my trim_string(weatherTemp, white_space, "both"))
set weatherCondition to weatherCondition & ", " & weatherTemp & degrees
set weatherWindChill to (do shell script "grep -E 'yweather:wind' " & weatherFile & "| sed -e 's/.*chill=//;s/direction=.*//' | sed 's/\"//g'") as string
set weatherWindChill to (my trim_string(weatherWindChill, white_space, "both"))
set weatherWindDirection to (do shell script "grep -E 'yweather:wind' " & weatherFile & "| sed -e 's/.*direction=//;s/speed=.*//' | sed 's/\"//g'") as string
set weatherWindDirection to (my trim_string(weatherWindDirection, white_space, "both"))
set weatherWindDirection to (my windDirection(weatherWindDirection))
set weatherWindSpeed to (do shell script "grep -E 'yweather:wind' " & weatherFile & "| sed -e 's/.*speed=//;s/\\/>.*//' | sed 's/\"//g'") as string
set weatherWindSpeed to (my trim_string(weatherWindSpeed, white_space, "both"))
set weatherWindChillSpeed to "Wind: " & weatherWindSpeed & " " & speed & " Direction: " & weatherWindDirection
set weatherSunrise to (do shell script "grep -E 'yweather:astronomy' " & weatherFile & "| sed -e 's/.*sunrise=//;s/sunset=.*//' | sed 's/\"//g'") as string
set weatherSunrise to (my trim_string(weatherSunrise, white_space, "both"))
set weatherSunset to (do shell script "grep -E 'yweather:astronomy' " & weatherFile & "| sed -e 's/.*sunset=//;s/\\/>.*//' | sed 's/\"//g'") as string
set weatherSunset to (my trim_string(weatherSunset, white_space, "both"))
set weatherSunrise24 to (h12toh24(weatherSunrise, ":"))
set weatherSunset24 to (h12toh24(weatherSunset, ":"))
set weatherSunRiseSet to "Sunrise: " & weatherSunrise24 & " Sunset: " & weatherSunset24
set weatherIcon to (do shell script "grep -E 'yweather:condition' " & weatherFile & "| sed -e 's/.*code=//;s/temp=.*//' | sed 's/\"//g'") as string
set weatherIcon to (my trim_string(weatherIcon, white_space, "both"))
do shell script ("cp " & pathName & "/png/" & weatherIcon & ".png " & pathName & "/WeatherIcon.png")
do shell script ("echo " & forecastDay1 & newline & forecastDay2 & newline & forecastDay3 & newline & weatherWindChillSpeed & newline & weatherSunRiseSet)
-- do shell script ("echo " & forecastDay1 & newline & forecastDay2 & newline & weatherWindChillSpeed & newline & weatherSunRiseSet & newline)
end run
on h12toh24(input, separator)
set t to words of text 1 thru -3 of input
if (text -2 thru -1 of input is "pm") then set item 1 of t to (item 1 of t) + 12
repeat 3 - (count t) times
set end of t to 0
end repeat
tell (1000000 + (item 1 of t) * 10000 + (item 2 of t) * 100 + (item 3 of t)) as text
return text 2 thru 3 & separator & text 4 thru 5
end tell
end h12toh24
on trim_string(the_string, trim_chars, trim_parameter)
set start_char to 1
set end_char to length of the_string
set all_chars to (characters of the_string)
if trim_parameter is in {"left", "both"} then
repeat with each_char in all_chars
if each_char is not in trim_chars then exit repeat
set start_char to (start_char + 1)
end repeat
end if
if trim_parameter is in {"right", "both"} then
set all_chars to reverse of all_chars
repeat with each_char in all_chars
if each_char is not in trim_chars then exit repeat
set end_char to (end_char - 1)
end repeat
end if
try
return text start_char thru end_char of the_string
on error
return ""
end try
end trim_string
on windDirection(theDegrees)
set degrees to theDegrees as number
if (degrees ≥ 0 and degrees ≤ 11.25) then
return "N"
end if
if degrees > 11.25 and degrees ≤ 33.75 then
return "NNE"
end if
if (degrees > 33.75 and degrees ≤ 56.25) then
return "NE"
end if
if (degrees > 56.25 and degrees ≤ 78.75) then
return "ENE"
end if
if (degrees > 78.75 and degrees ≤ 101.25) then
return "E"
end if
if (degrees > 101.25 and degrees ≤ 123.75) then
return "ESE"
end if
if (degrees > 123.75 and degrees ≤ 146.25) then
return "SE"
end if
if (degrees > 146.25 and degrees ≤ 168.75) then
return "SSE"
end if
if (degrees > 168.75 and degrees ≤ 191.25) then
return "S"
end if
if (degrees > 191.25 and degrees ≤ 213.75) then
return "SSW"
end if
if (degrees > 213.75 and degrees ≤ 236.25) then
return "SW"
end if
if (degrees > 236.25 and degrees ≤ 258.75) then
return "WSW"
end if
if (degrees > 258.75 and degrees ≤ 281.25) then
return "W"
end if
if (degrees > 281.25 and degrees ≤ 303.75) then
return "WNW"
end if
if (degrees > 303.75 and degrees ≤ 326.25) then
return "NW"
end if
if (degrees > 326.25 and degrees ≤ 348.75) then
return "NNW"
end if
if (degrees > 348.75 and degrees ≤ 360) then
return "N"
end if
return ""
end windDirection
I then have a collection of 47 PNGs for the weather icons downloaded from the web in the folder /Users/xxxx/Documents/Settings/WeatherIcon/png. Run the script via Geektool/Nerdtool.
I then point to the created PNG In the folder Users/xxx/Documents/Settings/WeatherIcon for the current weather icon.
HTH