Welcome to the Newschoolers forums! You may read the forums as a guest, however you must be a registered member to post. Register to become a member today!
For Forecast picture:
You will need 2 scripts, one in a Shell and one in an image
1. In the Shell you put:
curl --silent "http://ca.weather.yahoo.com/canada/ontario/toronto-4118/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\
Replace the toronto URL with the city of your choice. just go on yahoo weather and search ur city. (full size is 250x180 for resizing to scale)
2. in the Image you put
file:///tmp/weather.png
And the image will pop up.
dont forget to change the refresh rate from 0 to.... 1? 100? whatever.
_________________
UPDATE:
(remember change "CAXX0504" to your city.
Go here (scroll to RSS feed box)
http://www.weather.com/weather/rss/subscription/
Then submit your city, hit enter
now look at the address bar
should look LIKE this
"http://www.weather.com/weather/rss/subscription/CAXX0333"
the last combo of numbers and letters are mine, when u submit ur city youll get a diff combo
copy and paste your combo into the scripts and its now set for ur town)
Temp "2C"
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=CAXX0504&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1
Forecast "Partly Cloudy"
curl --silent "http://weather.yahooapis.com/forecastrss?p=CAXX0504&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' -e 's/, [0-9]* [A-Z]//' | tail -n1
2-Day Forecast
curl "http://xml.weather.yahoo.com/forecastrss?p=CAXX0504&u=c" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/Hi\:\ \(.*\)\ Lo\:\ \(.*\)/\?Hi\: \1\ Lo\:\ \2/" | sed "s/\?\(.*\)/\\1/"
-----------
Date/Time
Seconds
Date +%S
Month (full)
Date +%B
day "fri"
date +%a
Date +%M (mins)
Date +%I (hrs)
Just press random keys and figure all the other ones out.
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
And dont forget to change your refresh rate once you make a shell.
---------------------------
tell application "System Events"
set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
if powerCheck = 0 then
return ""
end if
end tell
tell application "iTunes"
try
set playerstate to (get player state)
end try
if playerstate = paused then
set trackPaused to " (paused, you must be watchin an edit)"
else
set trackPaused to ""
end if
if playerstate = stopped then
return "Why aint music playin?"
end if
set trackID to the current track
set trackName to the name of trackID
set artistName to the artist of trackID
set albumName to the album of trackID
set totalData to "Track : " & trackName & trackPaused & "
Artist : " & artistName & " " & albumName
return totalData
end tell
tell application "System Events"
set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
if powerCheck = 0 then
return ""
end if
end tell
tell application "iTunes"
try
set playerstate to (get player state)
end try
if playerstate = paused then
set trackPaused to " (paused, you must be watchin an edit)"
else
set trackPaused to ""
end if
if playerstate = stopped then
return "Why aint music playin?"
end if
set trackID to the current track
set trackName to the name of trackID
set artistName to the artist of trackID
set albumName to the album of trackID
set totalData to "Track : " & trackName & trackPaused & "
Artist : " & artistName & "
Album : " & albumName
return totalData
end tell
-----------------------------
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande}