Geektool Implementation

Got a program that plays well with SABnzbd? Share it here!
Post Reply
masterx
Newbie
Newbie
Posts: 29
Joined: March 13th, 2010, 5:34 am

Geektool Implementation

Post by masterx »

This code can display some basic info from SABNZBD in Geektool. Hope you like it :)

Code: Select all

curl --silent "http://localhost:8080/api?mode=qstatus&output=xml&apikey=APIKEY" | grep -e timeleft -e mb -e filename -e speed -e state| 
sed -e /'<jobs>'/s//''/ -e /'<job>'/s//''/ -e /'<timeleft>'/s//'Time Left: '/ -e /'<\/timeleft>'/s//''/ -e /'<mb>'/s//'Size: '/ -e /'<\/mb>'/s//' Mb'/ -e /'<filename>'/s//'File: '/ -e /'<\/filename>'/s//''/ -e /'<mbleft>'/s//'Size Left: '/ -e /'<\/mbleft>'/s//' Mb'/ -e /'<speed>'/s//'Bandwidth: '/ -e /'<\/speed>'/s//'Kb\/sec'/ -e /'<state>'/s//'State: '/ -e /'<\/state>'/s//''/ 
masterx
Newbie
Newbie
Posts: 29
Joined: March 13th, 2010, 5:34 am

Re: Geektool Implementation

Post by masterx »

Very simple script because of a well made program and documentation :)

The best part, is that it is possible to monitor all sabnzbd servers as long as you have webaccess to it and have the APIKEY :D

I just wish it could be possible to make the script smaller :)
clony3k
Newbie
Newbie
Posts: 8
Joined: February 3rd, 2010, 11:53 am

Re: Geektool Implementation

Post by clony3k »

How do i use it? i copy'ed and pasted it into shell with the command and a 2 sec refresh, but nothing comes up...
clony3k
Newbie
Newbie
Posts: 8
Joined: February 3rd, 2010, 11:53 am

Re: Geektool Implementation

Post by clony3k »

pair of dimes wrote:
clony3k wrote: How do i use it? i copy'ed and pasted it into shell with the command and a 2 sec refresh, but nothing comes up...
Are you using this in OS X? http://projects.tynsoe.org/en/geektool/
It's not simply a terminal command. It must be used with that program.
yeah, osx and geektool but whit no luck.. do i need to add the api key somewere in the code?
Camelot
Jr. Member
Jr. Member
Posts: 64
Joined: August 18th, 2008, 6:23 am

Re: Geektool Implementation

Post by Camelot »

yea, I am going to guess it's where it says:

Code: Select all

...apikey=APIKEY...
replace the APIKEY bit with your sabnzbd apikey
clony3k
Newbie
Newbie
Posts: 8
Joined: February 3rd, 2010, 11:53 am

Re: Geektool Implementation

Post by clony3k »

Camelot wrote: yea, I am going to guess it's where it says:

Code: Select all

...apikey=APIKEY...
replace the APIKEY bit with your sabnzbd apikey
Tried that, but with no luck....
Camelot
Jr. Member
Jr. Member
Posts: 64
Joined: August 18th, 2008, 6:23 am

Re: Geektool Implementation

Post by Camelot »

just to make sure we are on the same page: if you are running geektool on a different computer from the one running sabnzbd, have you changed the http command to query the ip of the machine running sabnzbd? (replace localhost with ip or dynamic dns hostname)?
What do you get returned if you run just this bit in the terminal:

Code: Select all

curl "http://<IP>:8080/api?mode=qstatus&output=xml&apikey=<APIKEY>"
I removed the "—silent" so we can potentially get some  more output
masterx
Newbie
Newbie
Posts: 29
Joined: March 13th, 2010, 5:34 am

Re: Geektool Implementation

Post by masterx »

pair of dimes wrote:
clony3k wrote: How do i use it? i copy'ed and pasted it into shell with the command and a 2 sec refresh, but nothing comes up...
Are you using this in OS X? http://projects.tynsoe.org/en/geektool/
It's not simply a terminal command. It must be used with that program.
Well it should work in terminal too... But i've only tested it on OSX (Geektool and Terminal) :)
lextou
Newbie
Newbie
Posts: 1
Joined: May 10th, 2010, 1:59 pm

Re: Geektool Implementation

Post by lextou »

thank you for the script; a very nice way to show the sabnzbd info on your desktop indeed! i wonder, is there a way to edit the script to just show the downloadspeed, the time remaining (for the active downloads) and the state? i've been tinkering with it a bit, but can't seem to get it to work properly! the result:

time remaining (active downloads)
time remaining (total downloads)
downloadspeed
time remaining (active downloads)
state

i would like to get rid of the first 2 output lines and let it start with the downloadspeed followed by remaining 2!

thanx in advance!
Post Reply