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.
Hi,
I was wondering if one of you know how to have skype contact list with geektool.

I've been trying to get this to work for the last two days. I've gotten the code from some other site and that doesn't work and my code that is slightly based off of that, doesn't work also.

I can get the right group of users, but trying to pull the user list from that group always returns a failure.
 
2) Adium contact list (this isn't Geektool, just Adium set up to be clear). It would go all the way down to the next section if more people were currently on facebook.
P.P.S. Let me know if you want any of the code I used, I can post it up here if someone wants it.

What setup are you using for adium to achieve that, and is it clickable, looks really cool - I may have to set that up myself.
 
Trouble with code

Hiya all i have been through the pages on this long post and not found what i have been looking for.

the Current weather conditions for me has recently changed and now gives me the weather and temperature. This means the Temperture appears twice in my Display.

Here is the code I have been using. I have tried to sort it myself but I have finding Unix scripting hard. (I have been trying I even bought a book)

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

RolKgOaOChtkrUcaj1KGQA



http://picasaweb.google.com/lh/photo/RolKgOaOChtkrUcaj1KGQA?feat=directlink

Thanks for your help.



is there a page where all these scripts have been collated?

Regards
Brendan
MGB
 
Hiya all i have been through the pages on this long post and not found what i have been looking for.

the Current weather conditions for me has recently changed and now gives me the weather and temperature. This means the Temperture appears twice in my Display.

Here is the code I have been using. I have tried to sort it myself but I have finding Unix scripting hard. (I have been trying I even bought a book)

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

RolKgOaOChtkrUcaj1KGQA



http://picasaweb.google.com/lh/photo/RolKgOaOChtkrUcaj1KGQA?feat=directlink

Thanks for your help.



is there a page where all these scripts have been collated?

Regards
Brendan
MGB

Just put the code from your post into a new shell window and am showing only one temp.
 

Attachments

  • Screen shot 2010-11-29 at 5.09.07 am.png
    Screen shot 2010-11-29 at 5.09.07 am.png
    36.6 KB · Views: 2,518
sorry i wasn't clear enough


I have two separate scripts so I can have them in different locations
one for the temp
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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

and one for the present weather
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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

Having the two scripts on my desktop show the temperature twice.
The reason for having a separate Temperature is purely for look

So how do i remove the temp readout from the Present weather script?


thanks
 
sorry i wasn't clear enough


I have two separate scripts so I can have them in different locations
one for the temp
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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

and one for the present weather
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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

Having the two scripts on my desktop show the temperature twice.
The reason for having a separate Temperature is purely for look

So how do i remove the temp readout from the Present weather script?


thanks

If I throw both of those into a terminal window, I get the following output:
Code:
$ curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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/ Z]//' | tail -n1
0°C
$ curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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
Light Snow

Don't see an issue on my end. I didn't throw it into a geeklet on my end because there should be no difference in how the commands are run between the Terminal and the shell script geeklet.
 
Decided to modify the Digg News grabber that I wrote for someone to do a general news grabber.


Here is some sample output:
Code:
- U.S. aircraft carrier heads for Korean waters
- Airlines low key in U.S. security controversy
- Teetering Irish government to set out 4-year plan
- Obama: eager to extend middle-class tax cuts
- All 29 trapped miners in New Zealand dead: police
- Oracle ruling tarnishes SAP's U.S. reputation
- Protests in Kabul as Afghan poll results released
- FBI raids send warning to hedge funds
- China turns up heat on Taiwan to talk politics
- Appeal trial for Briton sex murder starts in Italy

when i put that exact thing into my geektool nothing showed up on the rss. did i need to modify anything in that code? i'm not sure why its not working :(

my shell script is below

curl --silent "http://feeds.reuters.com/reuters/topNews.rss" > /tmp/news_feed.xml;
python /path/to/script/gen_news_grabber.py

?
 
xtacocorex Thanks for you help.
I think the issue is at yahoos end. they seem to have an intermittent problem. It sometimes comes and go.

This morning when I run the same script in Terminal I get the following result.


Code:
$ curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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
Mostly Cloudy, -1 C

I don't want to waste your time one a wild goose chase but thanks for you help.
 
when i put that exact thing into my geektool nothing showed up on the rss. did i need to modify anything in that code? i'm not sure why its not working :(

my shell script is below

curl --silent "http://feeds.reuters.com/reuters/topNews.rss" > /tmp/news_feed.xml;
python /path/to/script/gen_news_grabber.py

?
You need to change the path to point to the script, it is still set to "/path/to/script/". Replace that with the actual location of the script.
 
xtacocorex Thanks for you help.
I think the issue is at yahoos end. they seem to have an intermittent problem. It sometimes comes and go.

This morning when I run the same script in Terminal I get the following result.


Code:
$ curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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
Mostly Cloudy, -1 C

I don't want to waste your time one a wild goose chase but thanks for you help.

Totally tried it this morning and got exactly what you got.

Don't worry though, XML is easy to parse with Python, so I'll have a script that replaces all the regex (and is easier to use) uploaded sometime soon. Will try to get to it by tonight, hopefully you can wait til then.
 
Here's a simple iTunes info script (note it will keep iTunes open, so start a new group inside geektools where (if you need to) you can turn it off without disturbing your other geeklets.

Code:
#!/bin/sh
if ps x | grep iTunes | grep -q -v grep;   then 
  osascript -e 'tell application "iTunes"
set trackname to name of current track
set artistname to artist of current track
set albumname to album of current track
if albumname is null then
set albumshow to " "
else if albumname is "" then
set albumshow to " "
else 
set albumshow to " (" & albumname & ") " 
end if
set trackduration to duration of current track
set trackposition to player position
set elapsed to round (trackposition / trackduration * 100)
set output to "" & trackname & " - " & artistname & albumshow
  end tell' | iconv -f utf-8 -t ucs-2-internal
fi
If you make the text small (right alignment, personally), and set it to "always on top" you can fit it into your menu bar nicely. ;)
 
For everyone who is tired of dealing with regex for grabbing temperature (and the issues associated with it) from the Yahoo ForecastRSS feed for your weather, here is a simple Python script that will display the current condition and temperature based on command line input.

Save the following as "yahooweathergrabber.py" and chmod +x the file to make it executable.
Code:
#!/usr/bin/env python

# INITIAL FIGURING OUT OF XML PARSING FROM Thomas Upton's (http://www.thomasupton.com/) weather.py SCRIPT
# HAVE LEARNED A LOT FROM HIS PYTHON SCRIPT

import sys
from optparse import OptionParser
from xml.dom.minidom import parse

# SET UP WEATHER NAME SERVICE FOR THE XML
weatherNS = 'http://xml.weather.yahoo.com/ns/rss/1.0'

# SET UP THE COMMAND LINE OPTION HOLDER
cmdparse = OptionParser()
    
# ADD COMMAND LINE OPTIONS
cmdparse.add_option('-t', '--temp', action="store_true", default=False)
cmdparse.add_option('-c', '--cond', action="store_true", default=False)
cmdparse.add_option('-o', '--code', action="store_true", default=False)
cmdparse.add_option('-b', '--both', action="store_true", default=False)

# PARSE THE COMMAND LINE OPITONS
opts, args = cmdparse.parse_args(sys.argv[1:])

# PARSE THE XML FILE
dom = parse("/tmp/yahooweather.xml")

# GRAB THE UNITS OF MEASURE AND CURRENT CONDITION
currUNITS = dom.getElementsByTagNameNS(weatherNS, 'units')[0]
currCOND  = dom.getElementsByTagNameNS(weatherNS, 'condition')[0]

# PARSE OUT currUNITS AND currCond
unit     = currUNITS.getAttribute('temperature')
currWX   = currCOND.getAttribute('text')
currTEMP = currCOND.getAttribute('temp')
currCODE = currCOND.getAttribute('code')

# PRINT OUT DATA BASED UPON CLI ARGUMENTS
if (opts.temp):
    print currTEMP + unit

if (opts.cond):
    print currWX

if (opts.code):
    print currCODE
    
if (opts.both):
    print currWX + ", " + currTEMP + unit

How to use:
1 - In one (and only one) of your geeklets that you want to use for weather info, place one of the following command:
CELSIUS UNITS
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=<LOCATION CODE>&u=c" > /tmp/yahooweather.xml
FAHRENHEIT
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=<LOCATION CODE>" > /tmp/yahooweather.xml
Replace <LOCATION CODE> with your location code.

2 - Use these commands to get data:
TEMPERATURE
Code:
python /path/to/script/yahooweathergrabber.py -t
CURRENT CONDITION
Code:
python /path/to/script/yahooweathergrabber.py -c
CURRENT CONDITION & TEMPERATURE
Code:
python /path/to/script/yahooweathergrabber.py -b

Single Geeklet Setup:
This is how you would use this script if you wanted the condition and temperature in one geeklet (assuming Celsius for the XML)
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=<LOCATION CODE>&u=c" > /tmp/yahooweather.xml;
python /path/to/script/yahooweathergrabber.py -b

Multiple Geeklet Setup:
This is how you would use this script if you wanted the condition in one geeklet and the temperature in another geeklet (assuming Celsius for the XML)
Geeklet 1
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=<LOCATION CODE>&u=c" > /tmp/yahooweather.xml;
python /path/to/script/yahooweathergrabber.py -c
Geeklet 2
Code:
python /path/to/script/yahooweathergrabber.py -t

Sample Output: (from the command line and located in directory with script, but output here will display the same in Geektool)
(using the feed that madguernseyboy provided for getting help)
Code:
[19:28:16][user@comp]$ ./yahooweathergrabber.py -c
Snow
[19:28:21][user@comp]$ ./yahooweathergrabber.py -t
-2C
[19:28:26][user@comp]$ ./yahooweathergrabber.py -b
Snow, -2C
 
... here is a simple Python script ...
...
Sample Output: (from the command line and located in directory with script, but output here will display the same in Geektool)
(using the feed that madguernseyboy provided for getting help)
Code:
[19:28:16][user@comp]$ ./yahooweathergrabber.py -c
Snow
[19:28:21][user@comp]$ ./yahooweathergrabber.py -t
-2C
[19:28:26][user@comp]$ ./yahooweathergrabber.py -b
Snow, -2C

yeah, real simple... :p

i was just wondering, whats the difference between this script and this one that Im using right now?
Code:
curl "http://weather.yahooapis.com/forecastrss?p=CAXX0301&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>//'
I've had no problem with it...

thanks again!
 
yeah, real simple... :p

i was just wondering, whats the difference between this script and this one that Im using right now?
Code:
curl "http://weather.yahooapis.com/forecastrss?p=CAXX0301&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>//'
I've had no problem with it...

thanks again!
:(

It's no different, but I think it might be easier to use for people who want to break apart weather condition and temperature. This was written to solve the issue that madguernseyboy was having with his two weather scripts.

Multiple ways to solve the problem, I'm just bringing another solution to the table that people may or may not use.
 
thanks xtacocorex
your continued efforts to help others are outstanding. I think I speak from everyone when I say

Thank you
Brendan
 
:(

It's no different, but I think it might be easier to use for people who want to break apart weather condition and temperature. This was written to solve the issue that madguernseyboy was having with his two weather scripts.

Multiple ways to solve the problem, I'm just bringing another solution to the table that people may or may not use.

hey, I have nothing against you! you are a genius that brings another brick in the wall of geektool! (the first I've seen using Python anyway). plus its true that some people could want them separate... never really thought about this...
I was just wondering if maybe your script was less CPU demanding or something. thats all! :D

so once again, thank you for your scripts! I'm using them, and im sure im not the only one out there!
 
What setup are you using for adium to achieve that, and is it clickable, looks really cool - I may have to set that up myself.
Hey, just saw your reply. The basic idea is to set the Window style (Preferences -> Appearance -> Window Style) to "borderless window." Then I set the Color Theme to "Black is beautiful" and the List Layout to "HUD" (you may have to find those two on the web, I forget if they were default).

I then used "customize" on the List Layout to set alignment to the right, the cool cursive font as "Lucida Handwriting Ita . . . ", and the color to white.

The only issue I've had is that the gray scroll bar will appear if too many contacts are online; there doesn't seem to be a good way to get rid of that.

Hope this helps!
 
hey, I have nothing against you! you are a genius that brings another brick in the wall of geektool! (the first I've seen using Python anyway). plus its true that some people could want them separate... never really thought about this...
I was just wondering if maybe your script was less CPU demanding or something. thats all! :D

so once again, thank you for your scripts! I'm using them, and im sure im not the only one out there!

Frowny face was just for fun; knew your were giving me crap. :) Glad people like the scripts.

I actually got curious as to the timing of the scripts, so here is some data. I ran each option three times to sort of get a feeling for a "range" of how long each process would take. (and on with the thread-jacking)

1 - Raw Command Line with Regular Expressions
Code:
[19:15:57][user@comp]$ time curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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
Partly Cloudy, -4 C

real	0m0.424s
user	0m0.016s
sys	0m0.024s
[19:16:03][user@comp]$ time curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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
Partly Cloudy, -4 C

real	0m0.373s
user	0m0.015s
sys	0m0.015s
[19:16:18][user@comp]$ time curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&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
Partly Cloudy, -4 C

real	0m0.626s
user	0m0.015s
sys	0m0.016s

2 - Python Weather Script with download of XML file
Code:
[19:24:05][user@comp]$ time curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&u=c" > /tmp/yahooweather.xml; time ./yahooweathergrab.py -b

real	0m0.838s
user	0m0.007s
sys	0m0.007s
Unknown, -4C

real	0m0.211s
user	0m0.061s
sys	0m0.031s
[19:25:24][user@comp]$ time curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&u=c" > /tmp/yahooweather.xml; time ./yahooweathergrab.py -b

real	0m0.765s
user	0m0.007s
sys	0m0.007s
Unknown, -4C

real	0m0.093s
user	0m0.059s
sys	0m0.030s
[19:25:38][user@comp]$ time curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0860&u=c" > /tmp/yahooweather.xml; time ./yahooweathergrab.py -b

real	0m0.714s
user	0m0.007s
sys	0m0.007s
Unknown, -4C

real	0m0.093s
user	0m0.058s
sys	0m0.031s

3 - Python Weather Script (XML file already downloaded)
Code:
[19:40:40][user@comp]$ time ./yahooweathergrab.py -b
Unknown, -4C

real	0m0.095s
user	0m0.058s
sys	0m0.031s
[19:40:44][user@comp]$ time ./yahooweathergrab.py -b
Unknown, -4C

real	0m0.136s
user	0m0.061s
sys	0m0.030s
[19:40:47][user@comp]$ time ./yahooweathergrab.py -b
Unknown, -4C

real	0m0.108s
user	0m0.058s
sys	0m0.030s

Not sure what I think of the second set of data. I couldn't get the time command to time both at once, so I had to break it up. I think this might be an accurate representation as bash would need to figure out if it has multiple commands on one line and then execute in order they were given. I don't know how much overhead the time command used for that option also. I have this feeling that the output re-direct is the more intensive part of this option.

If the weather XML is already pulled down, the Python script is definitely faster than the command line regex version. If you wanted to reduce the overhead of Geektool even more, you could probably set up a cron job with the code to pull the weather XML file down and have that run on a 15 minute interval. This would get, what appears to be, a big task out of Geektool entirely.
 
for some reason I can't change the color of the font. I have the latest geektool

I go to the font and color tab and I click text color and shows me nothing.

any help?

Also what's a good font that looks smooth?
 
for some reason I can't change the color of the font. I have the latest geektool

I go to the font and color tab and I click text color and shows me nothing.

any help?

After you click on the button for "Click here to change font and color", look for the button with a T and green box on it. That will bring up the color picking window.
 
New user to GeekTool and have a couple of question....

I've added 3 shell scripts to my desktop. Two scripts are in a "time/date" group and one script is in an "ical" group. When I enable these groups, one of the groups always ends up with a frame around the scripts on the desktop.

The first time I did this, the ical script had a frame around it. I deleted everything and started over and the second time, the time/date group has frames around the scripts. Both groups have the same properties.

Any idea on what might be causing this and how to correct? Thanks.

EDIT: If I put all the scripts in the same group, the same thing occurs.
 
New user to GeekTool and have a couple of question....

I've added 3 shell scripts to my desktop. Two scripts are in a "time/date" group and one script is in an "ical" group. When I enable these groups, one of the groups always ends up with a frame around the scripts on the desktop.

The first time I did this, the ical script had a frame around it. I deleted everything and started over and the second time, the time/date group has frames around the scripts. Both groups have the same properties.

Any idea on what might be causing this and how to correct? Thanks.

EDIT: If I put all the scripts in the same group, the same thing occurs.

There is an option on how you want to border the geeklet, one of them is a frame. Disable that option and you should be good to go. (I'm running NerdTool, so I don't know where GeekTool 3 places that option, probably in the HUD window that pops up when you create a new Geeklet)
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.