Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.
i like your desktop. what is your weather script? i have the picture working, but my temp update disappeared today and it wont come back lol :confused:

The weather one i have requires 2 'shell' scripts and one 'file' script:

[shell] This one just sits there: (just sits on my desktop, doesnt display anything)

curl --silent "http://weather.yahoo.com/forecast/CITYCODE.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

[shell] This one displays conditons and temp:

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=CITYCODE&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' | tail -n1

[file] This one is the pic:

file:///tmp/weather.png

* Be sure to change "CITYCODE" to yahoo's code for your particular area.
 
A few more scripts

I was playing around with scripts (again, based on what others have done), and I've created two more for weather (since printer.wunderground.com stopped working yesterday):

The first one, currlocation.bash gets the zip code from my external IP address and displays the locaton:

Code:
#!/bin/bash

postal1=`curl -s http://phpweby.com/services/iplocation | awk '/Postal code:/{print $3}';`
postal=`echo "$postal1" | awk '{gsub(/<br>/,"")}; 1'`

#Gets the location of the city I'm in
 curl --silent "http://xml.weather.yahoo.com/forecastrss?p=$postal&u=f" | grep -E '(<yweather:location city|"US"/>)'  | sed -e 's/<yweather\:location city="/Current Location: /' -e's/"   country="US"\/>//' -e's/" region="/, /';

The second one, weather.bash, uses the same idea but only returns the current conditions (i.e. Fair, 62 F) and tomorrow's forecast (i.e. Wed: Mostly Cloudy 55|37)

Code:
#!/bin/bash

postal1=`curl -s http://phpweby.com/services/iplocation | awk '/Postal code:/{print $3}';`
postal=`echo "$postal1" | awk '{gsub(/<br>/,"")}; 1'`

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=$postal&u=f" | grep -e "Forecast:" -A2 -B2  |tail -n 4 | grep -v orecast | sed -e 's/<br \/>//' -e 's/<BR \/>//' |  sed -n -E '2n;s/[ ]\-[ ](.+)\..+:[ ]([0-9]+).+:[ ]([0-9]+)/\: \1, \2 | \3/;p';

curl --silent "http://weather.yahoo.com/forecast/$postal.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png

Edit: I forgot to mention that weather.bash also downloads the weather.png icon that I display with Geektool as a picture: (file:///tmp/weather.png)

I hope this helps others get their desktops set up the way they want...

Jim
 
Help with conditions script ..

Hey all 1st post here in forum and after search was awesome to see a GeekTool thread.

My problem is i have a script to show my temp
Code:
curl http://www.eldersweather.com.au/tas/lower-derwent/hobart?fc=9329  |sed -n '448p' |sed -e 's/<td class="center bold">//g' |sed -e 's/&.*//g'
And works mighty fine.
My dilemma is im wanting one to use so i can get the conditions from the same site http://www.eldersweather.com.au/tas/lower-derwent/hobart?fc=9329

Is anyone able to help me out please. I have tried and not being a code/shell script man not having much joy. The wunderland scripts i see on here arnt to my liking and seem to be out in the conditions and temp.

I am using this one for the weather icon and works wonders
Code:
file://localhost/weather.png

Any help would be greatly appreciated

Cheers
TattooedMac :)
 
my weather script stopped working at random.

My weather script has also stopped working :mad:

I tried to go to the wunderground printer page and there is an "Internal Server Error"???

Same here…
Where I had the current conditions I now only get a Generic "Conditions"…
this is the script right now:
lynx -dump http://printer.wunderground.com/auto/printer/global/stations/XXXXX.html|awk '/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i " " }'
XXXXX = location
 
printer.wunderground.com

Does seem to be down all around the board. I was able to get my conditions to work by switching my thread to m.wund.com.....

but the temperature still doesn't work.

I've emailed wunderground's tech support to find out if that's permanent or temporary.
 
Does seem to be down all around the board. I was able to get my conditions to work by switching my thread to m.wund.com.....

but the temperature still doesn't work.

I've emailed wunderground's tech support to find out if that's permanent or temporary.


I would go with the yahoo weather script since i doubt that would often be "down"

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=ENTERZIPCODEHERE&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' | tail -n1

It gives you a nice finish like this
tuh
 
Hey guys im a total noob when it comes to all this code stuff, ive got geektool and i managed to get my time/date etc showing, but i cant really customise it to save my life lol

I have Rainmeter on my PC and managed to get the time/date to look like this, is this possible to get it looking exactly the same using geek tool?

Pic: http://img204.imageshack.us/img204/5268/desktophq.jpg

And how can i get my iTunes to display like this using geektool;

Pic: http://img262.imageshack.us/img262/4323/geektool.png

Any help is appreciated, thanks guys.
 
calendar help?

hey guys, I'm new on macrumors, 'cause I need your help with my geektool configuration. I have only one problem with my calendar, 'cause I wanna have the week starting with Monday

I did this for the current month:

echo `date "+%B %Y"` | awk \
'{ print substr(" ",1,(21-length($0))/2) $0; }'; \
cal | awk '{ getline; print " Lu Ma Me Je Ve Sa Di"; getline; \
if (substr($0,1,2) == " 1") print " 1 "; \
do { prevline=$0; if (getline == 0) exit; print " "\
substr(prevline,4,17) " " substr($0,1,2) " "; } while (1) }' | \
awk -v cday=`date "+%d"` '{ fill=(int(cday)>9?"":" "); \
a=$0; sub(" "fill int(cday)" ","*"fill int(cday)"*",a); print a }'\

Now I don't want to have the date like this: *12*, but I wanna have nothing, so that I can add another calendar with the day in another color…

And I also have a geeklet showing the next month, like this:

cal -m $(date -v+1m +%b)

But I want the week to begin on a monday (Lu), like I have on the left…

Did someone understand what I meant and can help me, please? ^_^

Here's my desktop, so that you can see better:

http://att.macrumors.com/attachment.php?attachmentid=202941&stc=1&d=1258052551
 

Attachments

  • desktop.jpg
    desktop.jpg
    193.8 KB · Views: 559
For some strange reason, when using the image script, nothing now appears - it was working a few days ago and no longer.
The image doesn't appear to get updated in the /tmp directory - I'm using city code of ASXX0098

I can see the page at http://weather.yahoo.com/forecast/ASXX0098.html in a browser and have run the curl line in Terminal as well.

Any ideas - I can only think that Yahoo may have altered parameters of the image location that now throws the script.

The weather one i have requires 2 'shell' scripts and one 'file' script:

[shell] This one just sits there: (just sits on my desktop, doesnt display anything)

curl --silent "http://weather.yahoo.com/forecast/CITYCODE.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

[file] This one is the pic:

file:///tmp/weather.png

* Be sure to change "CITYCODE" to yahoo's code for your particular area.
 
For some strange reason, when using the image script, nothing now appears - it was working a few days ago and no longer.
The image doesn't appear to get updated in the /tmp directory - I'm using city code of ASXX0098

I can see the page at http://weather.yahoo.com/forecast/ASXX0098.html in a browser and have run the curl line in Terminal as well.

Any ideas - I can only think that Yahoo may have altered parameters of the image location that now throws the script.

Hi,
it looks like some things have changed.
To get it back to work just put your url in the browser window:
http://weather.yahoo.com/forecast/ASXX0098.html
and you'll see that it changes to
http://weather.yahoo.com/australia/queensland/redcliffe-1105289/
just use this new url in your script and you should be fine.

Cheers
 
Hey guys im a total noob when it comes to all this code stuff, ive got geektool and i managed to get my time/date etc showing, but i cant really customise it to save my life lol

I have Rainmeter on my PC and managed to get the time/date to look like this, is this possible to get it looking exactly the same using geek tool?

Pic: http://img204.imageshack.us/img204/5268/desktophq.jpg

And how can i get my iTunes to display like this using geektool;

Pic: http://img262.imageshack.us/img262/4323/geektool.png

Any help is appreciated, thanks guys.


Anyone? :(
 
Ive pretty much got my geek tool set up how i want it, im just stuck on a few bits of code:

1. In the examples everyones AM/PM is in caps like PM, mine displays it in lowercase: pm how can i get it in caps?

2. I couldn't get the weather working like displayed in the first post so i did some googling and did it a different method, heres the code:

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX1649&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>//'

Its displays it as: Partly Cloudy, 9 C, Anyway i can get it so it has the degrees sign then C? Or can anyone help me get the first method working? The website he uses doesn't have where i live :(

3. Last but not least, anyone know how to get your itunes to display like this:
http://att.macrumors.com/attachment.php?attachmentid=154623&d=1232917021
(I would PM the user but i cant)

Sorry for all the questions, thanks in advance!
 
The new yahoo URLs have killed my weather graphics.

I've followed the advice above and in other forums, but I am stuck.

My old URL was

HTML:
http://weather.yahoo.com/forecast/USCA0574.html

which now forwards to

HTML:
http://weather.yahoo.com/united-states/california/laguna-hills-2434647/

I've replaced the curl bit with the new address giving me

HTML:
curl --silent "http://weather.yahoo.com/united-states/california/laguna-hills-2434647/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

I've also tried

HTML:
curl --silent "http://weather.yahoo.com/united-states/california/laguna-hills-2434647/" | grep "weather_icon" | sed "s/.*background-image\:url(\(.*\))\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

All the above with the second shell of
HTML:
file:///tmp/weather.png

I then searched around and tried this combo:

HTML:
curl --silent "http://weather.yahoo.com/forecast/laguna-hills-2434647" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /weather.png
with
HTML:
file://localhost/weather.png
Still blank. Any help on this?
 
Copy Geektool Scripts to different Computer

I have a question----
HOW do I copy all of the scripts from my iBook to my eMac?
The eMac has the latest GeekTools 3 and the iBook has GeekTools 2.1.2.
And I want it to save the positions and fonts for all of the different scripts and what not that I have.

So... Can it even be done?

Thanks!
 
Hello All!

Just starting to play with GeekTool for the
first time. Thanks for all the shell commands.

Problem is, I create a new shell, put in the
command code and it doesn't show up.

EDIT: Okay, I changed the font color and it
shows up, but very small. Having problems
making the font bigger as it is not resizing
when I try and increase the fonts.

EDIT: Okay, somehow I am increasing the
fonts. Do I have to create a NEW SHELL for
every new piece of information? For instance,
the TIME and AM/PM -- are they separate shells
or can I roll them into one?

Also, to not hamper resources, you guys are
suggesting a 10s refresh on everything?
 
Hello All!

Just starting to play with GeekTool for the
first time. Thanks for all the shell commands.

Problem is, I create a new shell, put in the
command code and it doesn't show up.

EDIT: Okay, I changed the font color and it
shows up, but very small. Having problems
making the font bigger as it is not resizing
when I try and increase the fonts.

EDIT: Okay, somehow I am increasing the
fonts. Do I have to create a NEW SHELL for
every new piece of information? For instance,
the TIME and AM/PM -- are they separate shells
or can I roll them into one?

Also, to not hamper resources, you guys are
suggesting a 10s refresh on everything?

•Shells for each piece of information.
•Also depending on how often things need to be refreshed you can set your refresh rate. For the day, month and date I have it set for 1000. For iTunes I have it set for 10. For the iTunes track time I have it set at 1. Hope that helps.
 
So far, excellent....

Thanks Scotty!

I have DAY, MONTH, DATE, TIME, AM/PM
from the first page. Looks nice!

Now I have questions. Probably most all
asked already. Sorry to ask again but I
just started playing with this moments ago
and there are 40+ pages to go through.

Perhaps these can be answered again...

1. I have the Calendar displayed. I want the
day highlighted. How do I add that command?
is it a new shell or an edit to the existing script?

2. Weather. I read through the few first pages
to see that I need LYNX BROWSER. Saw no
supported browser for Snow Leopard. Can I
use the Leopard version?

I went ahead and installed an older version from
MacUpdate and put the lynx.command in applications.

Where do I put the weather commands? In a new
GeekTook shell?

3. Now, once I download it, what code do I need
to display the temperature and weather? Is there
also a code to display a SUN, CLOUDS, RAIN icon?

I am sorry to ask all this again. Perhaps someone
with a little time can post easy-to-follow answers.
Really loving this GeekTool, but I just want to get
over the learning curve. Thank you everyone.
 
*snip*
Do I have to create a NEW SHELL for every new piece of information? For instance, the TIME and AM/PM -- are they separate shells or can I roll them into one?

Also, to not hamper resources, you guys are suggesting a 10s refresh on everything?

•Shells for each piece of information.
*snip*

Need a different shell for each piece you want formatted differently (color, size, background, refresh, etc.) or placed in a different spot.

As noted above, refresh depends on the shell. I have my clock updating every second while the day updates every 12 hours. My forecast updates every 6 hours, and I have one that updates only once a week.
 
I am looking at Esswein's post (#1151) above.

He has two shell commands for weather and
one file command for the Weather ICON.

Could someone explain how I set this all up?

I just installed LYNX. The lynx.command is
in my APPLICATIONS folder.

That's all I know at this point. Now what?

Looking at Esswein's post:

The weather one i have requires 2 'shell' scripts and one 'file' script:

[shell] This one just sits there: (just sits on my desktop, doesnt display anything)

curl --silent "http://weather.yahoo.com/forecast/CITYCODE.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\


That did nothing. Someone want to explain why?
(And yes I put in city code)

[shell] This one displays conditons and temp:

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=CITYCODE&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' | tail -n1

[file] This one is the pic:

file:///tmp/weather.png

* Be sure to change "CITYCODE" to yahoo's code for your particular area.


Using the CURL commands it seemed to work.

The first command worked. I now have a forecast on my desktop.

How do I create a .PNG file with clouds/Sun/Rain, etc?

Can someone take me step-by-step through this?
 
Can someone take me step-by-step through this?

Finally got mine working again. First make a shell (Geektool 3 — drag 'shell' onto desktop) for:
HTML:
curl --silent "http://weather.yahoo.com/united-states/california/laguna-hills-12796577/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

This shell will always be blank. It's creating the png. You can check to see if it's working by clicking on the desktop so the menu bar reads Finder. Go menu -> Go To Folder -> type /tmp/ then hit enter. You should see a fie 'weather.png' If it's not there, do two things. One, check the URL in the code—NOT JUST THE CITY CODE. Yahoo changed some of the URLs. Go to yahoo weather, type in your city and when that comes up, use that URL in the code above.

If you still don't see the .png, try running the script in Terminal. It will take a few seconds. (I don't know if this is necessary, but I did it and I'm up and running.)

Then drag the 'Image" box from Geektool to the desktop and paste:
HTML:
file:///tmp/weather.png

Hit the refresh all link in Geektool and presto!

Hope that helps. This thread is exhausting to read through. =)
 
rkunda,


Before I start all this...

What would be the code for my city?

curl --silent "http://weather.yahoo.com/united-states/california/laguna-hills-12796577/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

I live in NJ 07724

Thank you in advance. Can't wait to try this.
 
rkunda,


Before I start all this...

What would be the code for my city?

curl --silent "http://weather.yahoo.com/united-states/california/laguna-hills-12796577/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

I live in NJ 07724

Thank you in advance. Can't wait to try this.

I think it should look like this.

HTML:
curl --silent "http://weather.yahoo.com/united-states/new-jersey/eatontown-12760852/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\
 
GeekTools & Stock Quotes

Following some existing posts on the subject of stock quotes in this thread I tried this to get Citigroup.

Code:
curl http://www.google.com/finance?q=NASDAQ%3AC | sed -n '/MARKET DATA AND CHART/,/Open:/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '1,9d' | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed 's/^/C: /g' | sed '2,9d' | sed 's/).*/)/g'

However, there is no information at all shown in the shell window.

Using Geektools ver. 3.0 RC5 (build 116).
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.