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.
Here, I wrote this code which will give you the full URL of the image you are looking for.

Code:
curl --silent "http://weather.yahoo.com.au/local-conditions/nsw/sydney" | grep -m 1 '/styles/icons/yahoo7/large/' | cut -d\" -f6 | sed s#^#http://weather.yahoo.com.au#

If just the URL isn't what you were looking for let me know.

Thanks a heap!!!

I've added one more command to save to file

Code:
curl --silent "http://weather.yahoo.com.au/local-conditions/nsw/sydney" | grep -m 1 '/styles/icons/yahoo7/large/' | cut -d\" -f6 | sed s#^#http://weather.yahoo.com.au# | xargs curl --silent -o /tmp/weather.png
 
Last edited:
I'm currently running 11 separate scripts and only consumes 25.7MB. Let me know what you think!

~ :apple:

that is a great looking Rolex clock....

how do you get something like that analog clock?
 

Attachments

  • ioioi_100611.jpg
    ioioi_100611.jpg
    250.9 KB · Views: 470
Need some help finding an old script I used that didn't save. Looking for the Ram usage in the corner that shows how much was used in MB and how much was free in %.

If anyone could help that'd be great.
 

Attachments

  • Screenshot2010-06-17at91801PM.png
    Screenshot2010-06-17at91801PM.png
    116.7 KB · Views: 349
hi at all, is the first time that I use geektool, I have a question, how can I gat all CPU (I have a MBP 2001 i7) usage?



kikko088
 
Can anyone who is using my Five Day Forecast script confirm that it is not working for them?

If it is not working, could you please run the command you have in your geeklet in Terminal.app and PM me the results?

Thanks!
 
Can anyone who is using my Five Day Forecast script confirm that it is not working for them?

If it is not working, could you please run the command you have in your geeklet in Terminal.app and PM me the results?

Thanks!

That's funny... I just finished setting it up about 5 minutes ago. Used the info on your Wiki page, changed it to my location and it worked. Then a minute ago it disappeared and isn't working. :confused:

EDIT: It's working again.
 

Attachments

  • Screen capture 1.jpg
    Screen capture 1.jpg
    1.1 MB · Views: 227
Last edited:
how can I change the units in 5 day forecast? from Fahrenheit to Celsius?I try to change UNITS="C" into the script but nothing
 
how can I change the units in 5 day forecast? from Fahrenheit to Celsius?I try to change UNITS="C" into the script but nothing

Ok, that's what I'm seeing, so you just confirmed the issue. I'll look into it tonight, but I'm out of town this weekend. Hopefully it will be a quick fix.
 
Can someone help me figure out how to change this script to check college football scores? Particularly, UT and Big 12 schools?

#!/bin/bash
#This script was written on August 27, 2011 by Kyle R. Jones (kr.jones@me.com)
#Place any number of teams into the team list. This list is then parsed from "http://www.nfl.com/liveupdate/scorestrip/ss.xml"
#for the current score. My intended goal is to use this with geektool.

team=(DAL GB PHI NYG WAS)

for i in ${team[@]}; do

home_city=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*h="\([^"]*\)".*/\1/'`
visiting_city=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*v="\([^"]*\)".*/\1/'`

home_team=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*hnn="\([^"]*\)".*/\1/'`
visiting_team=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*vnn="\([^"]*\)".*/\1/'`


first=`echo ${home_team} | sed 's/\(.\).*/\1/'`
last=`echo ${home_team} | sed 's/.\(.*\)/\1/'`
upper=`echo ${first} | tr '[a-z]' '[A-Z]'`
home_team="$upper$last"

first=`echo ${visiting_team} | sed 's/\(.\).*/\1/'`
last=`echo ${visiting_team} | sed 's/.\(.*\)/\1/'`
upper=`echo ${first} | tr '[a-z]' '[A-Z]'`
visiting_team="$upper$last"


home_score=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*hs="\([^"]*\)".*/\1/'`
visiting_score=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*vs="\([^"]*\)".*/\1/'`

quarter=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*q="\([^"]*\)".*/\1/'`
time_left=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*k="\([^"]*\)".*/\1/'`

day=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.*d="\([^"]*\)".*/\1/'`
time=`curl -s http://www.nfl.com/liveupdate/scorestrip/ss.xml | grep ${i} | sed -e 's/.* t="\([^"]*\)".*/\1/'`


if [ $quarter = "F" ]; then
echo ${visiting_city} ${visiting_team} ${visiting_score} ${home_city} ${home_team} ${home_score} FINAL
elif [ $quarter = "P" ]; then
echo ${visiting_city} ${visiting_team} at ${home_city} ${home_team} on $day at $time Eastern
elif [ $quarter = "H" ]; then
echo ${visiting_city} ${visiting_team} ${visiting_score} ${home_city} ${home_team} ${home_score} HALFTIME
else
if [ $quarter = "1" ]; then
echo ${visiting_city} ${visiting_team} ${visiting_score} ${home_city} ${home_team} ${home_score} with ${time_left} in the ${quarter}st
elif [ $quarter = "2" ]; then
echo ${visiting_city} ${visiting_team} ${visiting_score} ${home_city} ${home_team} ${home_score} with ${time_left} in the ${quarter}nd
elif [ $quarter = "3" ]; then
echo ${visiting_city} ${visiting_team} ${visiting_score} ${home_city} ${home_team} ${home_score} with ${time_left} in the ${quarter}rd
else
echo ${visiting_city} ${visiting_team} ${visiting_score} ${home_city} ${home_team} ${home_score} with ${time_left} in the ${quarter}th
fi
fi
done
 
My Desktop

The background is the current weather photo from noaa for my region:
http://www.nnvl.noaa.gov/satimg/GERVISIR.JPG
I use a script to grab it every 30 min and then 'killall Dock' to force it to update. so i have a nice current HD weather photo for my background.

code for the header:
Code:
CN=$(scutil --get ComputerName) ; echo "\033[4m$CN\033[0m";echo `sw_vers -productName` \(v`sw_vers -productVersion`\) - `sysctl -n hw.model`; echo `sysctl -n machdep.cpu.brand_string | sed -e 's/([^)]*)//g' | tr '@' '-'`;sysctl -n hw.memsize | awk '{print $0/1073741824" GB RAM"}';

Crossfit WOD using xtacocorex's script here:
https://forums.macrumors.com/posts/13325664/

My GasBuddy script to evaluate competition. (I run a gas station)
& Veeder Root readings for my tanks.

Thank you to xtacorex for his awesome python scripts and everyone else who's code was hacked chopped and mutilated to get this to work. :D

Mano


oops forgot to mention. I wrote a quick bash script to backup my geektool prefs. It seems as I'm arranging things i tend to accidentally delete windows and then need to figure out where i saved or found the code to re-make the window.
Anyway if anyone is interested it saves a backup in ~/Library/Preferences/GeekToolBackups:

Code:
#! /bin/bash
mkdir -p ~/Library/Preferences/GeekToolBackups
cp ~/Library/Preferences/org.tynsoe.geeklet.image.plist ~/Library/Preferences/GeekToolBackups/org.tynsoe.geeklet.image.plist_`date +%Y%m%d_%H%M`
cp ~/Library/Preferences/org.tynsoe.geeklet.shell.plist ~/Library/Preferences/GeekToolBackups/org.tynsoe.geeklet.shell.plist_`date +%Y%m%d_%H%M`
cp ~/Library/Preferences/org.tynsoe.geektool3.plist ~/Library/Preferences/GeekToolBackups/org.tynsoe.geektool3.plist_`date +%Y%m%d_%H%M`
exit 0
 

Attachments

  • desktop.jpg
    desktop.jpg
    119.1 KB · Views: 230
Last edited:
This is my current Desktop:
(geektools, candybar)



Possible to make shadow for the letters? Because its only show for images in geektools...
Or the easiest way to duplicate everything as a shadow?
 
Hi all.

I'm very new to Geektool (well started today actually!) & cannot code but I can paste!
I have gone through nearly all the threads here & I think my eyes are bleeding! I still cannot get the temperature to display, this is the shell I am using, can someone tell me which part is incorrect (hopefully not all of it!?:

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

Also, is there any alternative to the Yahoo weather pic, I really would like one in black & white (probably wishful thinking).

This is where my desktop is so far........
 

Attachments

  • Screen shot 2011-09-18 at 18.11.55.jpg
    Screen shot 2011-09-18 at 18.11.55.jpg
    115.6 KB · Views: 287
Hi all.

I'm very new to Geektool (well started today actually!) & cannot code but I can paste!
I have gone through nearly all the threads here & I think my eyes are bleeding! I still cannot get the temperature to display, this is the shell I am using, can someone tell me which part is incorrect (hopefully not all of it!?:

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

Also, is there any alternative to the Yahoo weather pic, I really would like one in black & white (probably wishful thinking).

This is where my desktop is so far........


Here is the code I am using.

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

Try pulling the " | tail _n1" off

also, I think your yahoo weather URL is bad. I cannot get it to pull up anything. what city are you in?
 
Here is the code I am using.

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

Try pulling the " | tail _n1" off

also, I think your yahoo weather URL is bad. I cannot get it to pull up anything. what city are you in?

I'm in the UK & I can get your code to work correctly...

This is the URL that shows the current weather:
http://uk.weather.yahoo.com/england/bedfordshire/bedford-26449242/

Which bit exactly do I substitute as I tried to use the whole url & also just changing the code at the end to no avail......

Thanks for your help!:):)
 
How do I get the dock to look like that too? I know it's not geektool persay but what program?

I don't remember how I got the dock clear, but I initially set it to the 2D dock and then I think I used Mirage. There are a couple of programs/system preference panes that allow you to move the location of the dock. I use Secrets and TinkerTool. Don't know if they work for Lion, I'm still on Snow Leopard.

The dock "background" is geektool.
 
Hey guys, I use geek tool to tell my my current trash size. I was using the du-sh command since Leopard anad had no issues. But in Lion (after installing the Geektool from the mac appstore) it no longer works.

here is what I am using to display the total size of the trash.
du -sh ~/.Trash/ | awk '{print $1}

Any one know why it stopped working?
 
Here is the code I am using.

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

Try pulling the " | tail _n1" off

also, I think your yahoo weather URL is bad. I cannot get it to pull up anything. what city are you in?

Don't worry, sussed it!
 
Just fooling around

I wanted to see if I could replicate the Metro UI feel with geektool.

With geektool 3 being terriby unstable for me, I reverted to v2.1.2.

Started with a brand new install, so the desktop is still clean. this is where I got, tell me what you think:

2ij59b8.jpg


PS never mind the wallpaper, I just wanted to get your feedback on the Geektool stuff :)

PPS changed the wallpaper. This one makes the geeklets look better :)
x60hw.png
 
Last edited:
Not bad. To make it a little more metro-ish, you might want to consider make the various tiles different colors.

I wasn't sure about that. Looks like on the phone they're all the same color from what I've seen online, I'm not an expert though, I don't own a windows phone and I've not been able to get Windows 8 to install :rolleyes:

I wasn't sure about the green either, but I'm slowly getting used to it, so it may stay like that for some time.

D
 
I wasn't sure about that. Looks like on the phone they're all the same color from what I've seen online, I'm not an expert though, I don't own a windows phone and I've not been able to get Windows 8 to install :rolleyes:

I wasn't sure about the green either, but I'm slowly getting used to it, so it may stay like that for some time.

D

No, you're right. On a Windows Phone, the tiles are the same color. I was thinking of the Metro UI that's in Windows 8.
 
Hi antcuc,

It's actually just a simple workaround. You make two scripts laid on top of each other, one in green and one in red. Then you configure the red one not to print anything if the stock has gone up and green one not to print anything if the stock has gone down.

So, take a general stock quote script. Here's mine for the DOW:

curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/DOW: /g'

That outputs: DOW: 9,256.26 -24.71 (-0.27%)

Now copy it so you have two.

Then add this to the end of the one you make red:
| sed -n '/-/p'
That makes it so it will only print lines where a "-" appears, so it'll only give the output if things went south that day.

Then, add this one to the one that you make green:
| sed '/-/d'
That'll delete the output if a "-" appears, so it'll only print if the index went up or stayed put.

Since, you're just modifying the format of the two scripts, you can have any change occur depending on whether things went up or down. You could have the background change colour or tranparency. You could change the font, size, whatever.

Hope that helps, let me know if you have any other questions.

(Oh yeah, and to make this work for other stocks, you just have to change the link in the original curl script, and then change the label that you give it at the end of the script)

zzzzzzz -

When I try this curl outputs some transfer data. Any thoughts:

11:04 AM ~ => curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/DOW: /g'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 53098 0 53098 0 0 184k 0 --:--:-- --:--:-- --:--:-- 216k
DOW: 10,861.09 +89.61 (0.83%)
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.