epic post? formatting will be off... this is what im emailing to ppl
i made this for all NSers who are asking for geektool help. should cover lots
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.
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.
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
(remember change "CAXX0504" to your city.
Go here
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.
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
More Scripts:
-------------------------------------------------------------------------------------
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=CAXX0504&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>//'
-------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------
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/"
-------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------
Try them all (duplicates from above)
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
For the Date and time
Type
Date +%B
in the command box of the preference window for a "Shell" (shows up when you drag shell onto desktop)
and you can change the B to anything on ur keyboard and get different results. so you can get the clock, the date, the month, the hour, the second, the AM/PM the year etc just try them all XCVBNM are the bigger ones i think.
they are case sensitive*
And dont forget to change your refresh rate once you make a shell.
If you want to write text, like a title for something, or your city name or your name whatever
type
--------------------
echo yourtexthere
--------------------
ITUNES:
in text edit.app put this (make a new file)
-------------------------------------------------------------------------------------
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"
else
set trackPaused to ""
end if
if playerstate = stopped then
return " Stopped"
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
return totalData
end tell
---------------------------------------------------------------------------------
then save as iTunesInfo.txt
save it in documents>geektool(make a geektool folder)
once saved, change the ".txt" to ".scpt"
then in a geektool command put
osascript /Users/YOURUSERNAME/documents/geektool/iTunesInfo.scpt
tada