Remember the Geek: RTM for GeekTool

dws90 says:
I started playing around with GeekTool (http://projects.tynsoe.org/en/geektool/) this weekend. For those who haven't heard of it before, GeekTool is a Mac program that displays "stuff" directly on the desktop. "Stuff" can be files, images, or anything output by a script. It's a very useful program, so I highly recommend all Mac users try it out.
After getting the weather and a calendar setup, I looked for a way to display my RTM tasks on it. The scripts I found seemed to be needlessly complex, so I decided to write a nice, simple one using the Atom feeds. In case someone else here uses GeekTool, I'm sharing it with the world:
http://www.starsage.net/files/scripts/rememberthegeek.py.zip
I included needlessly detailed instructions in the file, so hopefully there won't be any problems. I'd love feedback, though, so if you do have any issues, let me know.
After getting the weather and a calendar setup, I looked for a way to display my RTM tasks on it. The scripts I found seemed to be needlessly complex, so I decided to write a nice, simple one using the Atom feeds. In case someone else here uses GeekTool, I'm sharing it with the world:
http://www.starsage.net/files/scripts/rememberthegeek.py.zip
I included needlessly detailed instructions in the file, so hopefully there won't be any problems. I'd love feedback, though, so if you do have any issues, let me know.

emily (Remember The Milk) says:
Hi dws90,
Neat script. :) I just wanted to let you know that your tip is a Tips & Tricks Tuesday winner. We've upgraded your RTM account to have a free year of Pro. :)
Neat script. :) I just wanted to let you know that your tip is a Tips & Tricks Tuesday winner. We've upgraded your RTM account to have a free year of Pro. :)

dws90 says:
Awesome. Thanks!

t.h.chia says:
Hi, I can't seem to find the instructions. All that I get is a python script.
How do I install it? Thanks very much (I love GeekTool).
How do I install it? Thanks very much (I love GeekTool).

(closed account) says:
Great, but fails at the first accent character :( (é,à, è, ...)

duane.hubbard says:
This also works great in Conky (linux). Thanks!

(closed account) says:
It seems to fail at the first accent character, or Euro symbol, when the script is used within GeekTool.
It works well from the Terminal.
I tried adding: "# coding: utf-8" as the first or second line in the script but I had no luck.
Any hint? :(
It works well from the Terminal.
I tried adding: "# coding: utf-8" as the first or second line in the script but I had no luck.
Any hint? :(

xeophin says:
Yeah, a solution for this would be great ... otherwise it isn't much help, though it looks great when it runs in the terminal ^_^

(closed account) says:
I found a recipe that works for me:
in function displayList, substitute any occurrence of:
print <some_string>
with:
print unicode(<some_string>).encode("utf-8")
I'm sure there's a more clever way of doing this, though :)
Credits go to these guys:
http://www.saltycrane.com/blog/2008/11/python-unicodeencodeerror-ascii-codec-cant-encode-character/#comments
in function displayList, substitute any occurrence of:
print <some_string>
with:
print unicode(<some_string>).encode("utf-8")
I'm sure there's a more clever way of doing this, though :)
Credits go to these guys:
http://www.saltycrane.com/blog/2008/11/python-unicodeencodeerror-ascii-codec-cant-encode-character/#comments

rplakas says:
I'm getting invaild syntax on line 84:
with open(path, "r") as f:
^
with open(path, "r") as f:
^

tahoo.tahooo says:
what shall i do after the terminal opens?

dws90 says:
@t.h.chia - The instructions are at the top of the script. Open the script in a text editor and it should be pretty obvious.
@ the rest of you: It's failing on accented characters, but only when run through GeekTool? That sounds like a GeekTool bug, so I'm not sure there's much a can do, but I'll look into it.
@ the rest of you: It's failing on accented characters, but only when run through GeekTool? That sounds like a GeekTool bug, so I'm not sure there's much a can do, but I'll look into it.

viewer says:
Is the first accent character problem related to this error?:
Traceback (most recent call last):
File "~/Documents/Scripts/rememberthegeek.py", line 187, in
displayFeeds(feeds)
File "~/Documents/Scripts/rememberthegeek.py", line 182, in displayFeeds
displayList(listTitle, tasks)
File "~/Documents/Scripts/rememberthegeek.py", line 149, in displayList
print "\t%s\n\t\t%s\t\t%s" % (task["title"], task["due"], task["list"])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 68: ordinal not in range(128)
Thank you very much!
Traceback (most recent call last):
File "~/Documents/Scripts/rememberthegeek.py", line 187, in
displayFeeds(feeds)
File "~/Documents/Scripts/rememberthegeek.py", line 182, in displayFeeds
displayList(listTitle, tasks)
File "~/Documents/Scripts/rememberthegeek.py", line 149, in displayList
print "\t%s\n\t\t%s\t\t%s" % (task["title"], task["due"], task["list"])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 68: ordinal not in range(128)
Thank you very much!

mle21 says:
The script still doesn't seem to be executable for me. Anyone else have this problem?

mle21 says:
...I'm still running 10.4.11, if that makes a difference.

(closed account) says:
@viewer: yes it's related to that error
@dws90: if we run your Python script redirecting its output to a file, then it raises that Unicode error above
@dws90: if we run your Python script redirecting its output to a file, then it raises that Unicode error above

viewer says:
I should note that the error I posted above came straight out of the terminal. My desktop doesn't have enough space to display enough of my tasks to reach that point.

dws90 says:
It was just a simple encoding issue. I've posted a new version of the script that should fix it (same URL as before), so give it a shot and let me know if things still aren't working.

(closed account) says:
Will this only work for public lists? My lists are private and require username and password, yet there doesn't seem to be any place to enter in the script. Obviously, when I run the script in Geektool I get "Unable to access feed". Am I missing something?

(closed account) says:
Of course, two seconds later I figured it out. Private addresses need to be turned on.

amaechler says:
To fix problems with Unicode, add these lines to the top of the Script:
import codecs
import locale
import sys
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)
import codecs
import locale
import sys
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)

zathraszero says:
I'm getting the same error as rplakas
This is what I get in Terminal:
rememberthegeek.py:87: Warning: 'with' will become a reserved keyword in Python 2.6
File "rememberthegeek.py", line 87
with open(path, "r") as f:
^
SyntaxError: invalid syntax
Running on 10.5 with Python 2.5.1 to one that comes with Leopard
This is what I get in Terminal:
rememberthegeek.py:87: Warning: 'with' will become a reserved keyword in Python 2.6
File "rememberthegeek.py", line 87
with open(path, "r") as f:
^
SyntaxError: invalid syntax
Running on 10.5 with Python 2.5.1 to one that comes with Leopard

zathraszero says:
Actually the ^ sits under the o in open in the out not quite like it has been shown above.

viewer says:
It now works flawlessly. Thanks dws90 for your responsiveness!


spunkytofu says:
No errors, but the box is just blank.

spunkytofu says:
In terminal, it does nothing. Just prints the same line waiting for me to add another command.

xeophin says:
The new version works with accented characters – great, works perfectly. Thanks!

(closed account) says:
Remember that in both the terminal and in Geektool you have to phrase the run command as:
python /Users/yourusername/path/to/rememberthegeek.py
python /Users/yourusername/path/to/rememberthegeek.py

spunkytofu says:
Adding "python" to the front in GeekTool changes nothing. In terminal, it returns this:
88: Warning: 'with' will become a reserved keyword in Python 2.6
File "/Users/krayziesaiko/Sphen/rtm.desktop/rememberthegeek.py", line 88
with open(path, "r") as f:
^
SyntaxError: invalid syntax
88: Warning: 'with' will become a reserved keyword in Python 2.6
File "/Users/krayziesaiko/Sphen/rtm.desktop/rememberthegeek.py", line 88
with open(path, "r") as f:
^
SyntaxError: invalid syntax

vivek.gera says:
rememberthegeek.py:88: Warning: 'with' will become a reserved keyword in Python 2.6
File "rememberthegeek.py", line 88
with open(path, "r") as f:
^
SyntaxError: invalid syntax
I get this unfortunate error.
File "rememberthegeek.py", line 88
with open(path, "r") as f:
^
SyntaxError: invalid syntax
I get this unfortunate error.

dws90 says:
It would appear that I was using something introduced in Python 2.6, which doesn't seem to be in Leopard. I don't have a Leopard machine available to test with, but I just uploaded a new version that should fix the error some of you are getting. Please download the new version of the script and let me know if you continue to get the error.
(It was a silly little thing. That's what I get for listening to the documentation when it says "You should do it this clever way because it's better!")
(It was a silly little thing. That's what I get for listening to the documentation when it says "You should do it this clever way because it's better!")

jameson.smiith says:
This sounds like a great idea, but like several others, I receive the following error and a blank GeekTool box:
File "/Users/Jameson/Documents/GeekTool/Scripts/rememberthegeek.py", line 89
with open(path, "r") as f:
^
SyntaxError: invalid syntax
(the ^ should be under the "o" in "open").
If it helps, I'm running OS X 10.4.11 and Python 2.3.5 (came with Tiger) and redownloaded the script after dws90's most recent post.
File "/Users/Jameson/Documents/GeekTool/Scripts/rememberthegeek.py", line 89
with open(path, "r") as f:
^
SyntaxError: invalid syntax
(the ^ should be under the "o" in "open").
If it helps, I'm running OS X 10.4.11 and Python 2.3.5 (came with Tiger) and redownloaded the script after dws90's most recent post.

thanks for the update, worked just fine on machine with the update...its a leopard machine...and it is definitely Python 2.6. No more with syntax error.
Anyway very cool script, it looks like you are parsing the xml, so theoretically you could print whatever attributes show up in the file right?
For example I only use the due date on one list, but use urls and priorities for most of the others. I'm guessing it wouldn't take much work to set that up...?
Anyway very cool script, it looks like you are parsing the xml, so theoretically you could print whatever attributes show up in the file right?
For example I only use the due date on one list, but use urls and priorities for most of the others. I'm guessing it wouldn't take much work to set that up...?

dws90 says:
@jameson.smith: The line mentioned in your error message is no longer present in the latest version of the script, so it looks like you have an older version. Please redownload the script and try again.
@bmcquist: Yes, it's quite easy to change the output. You'll need to modify the createDictionaryFromTask() function to grab the attribute(s) you want, and then change displayList() to print it out. Just follow the example of what's already there.
@bmcquist: Yes, it's quite easy to change the output. You'll need to modify the createDictionaryFromTask() function to grab the attribute(s) you want, and then change displayList() to print it out. Just follow the example of what's already there.

spunkytofu says:
Working now. Thanks.

c0debabe says:
Thanks for sharing!

filemakerdave says:
I have everything install with private address "on" and get unable to access the feed. I get the feed ok when I click the Atom feed.

jinegao says:
yes

heathercmiller says:
@filemakerdave
I had the same problem. I first copied and pasted the URL of my feed into rememberthemilk.py before I went into Settings and set private address "on".
I was still getting "unable to access the feed"
Then I went in and checked the URL again, and found that after I had turn private addresses on, it indeed gave me a private address (doh) that was much longer the the public address I had initially tried.
So I pasted the uber long private address into rememberthemilk.py, and voila, works like a charm.
Though I'd share my rookie mistake. Hope it helps someone :-)
I had the same problem. I first copied and pasted the URL of my feed into rememberthemilk.py before I went into Settings and set private address "on".
I was still getting "unable to access the feed"
Then I went in and checked the URL again, and found that after I had turn private addresses on, it indeed gave me a private address (doh) that was much longer the the public address I had initially tried.
So I pasted the uber long private address into rememberthemilk.py, and voila, works like a charm.
Though I'd share my rookie mistake. Hope it helps someone :-)

perezcarballo says:
Hi all,
I'm using OSX 10.6.1, and RTMFetch 1.1. I followed the instructions but I keep getting this error message:
2009-11-25 20:16:09.258 Python[54047:d07] Error loading /Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: dlopen(/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain, 265): no suitable image found. Did find:
/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: no matching architecture in universal wrapper
Traceback (most recent call last):
File "rtmfetch.py", line 33, in
from RTMFetcher.RTMFetcher import RTMFetcher
File "/Applications/RTMFetch 1.1/RTMFetcher/RTMFetcher.py", line 41, in
objc.loadBundle('RTMKeychain', RTMKeychain.__dict__, bundle_path=os.path.join(os.path.dirname(__file__), '../RTMKeychain.framework'))
ImportError: Bundle could not be loaded
Any clues? (Apparently, I'm running Python 2.6.1.)
Thanks!
I'm using OSX 10.6.1, and RTMFetch 1.1. I followed the instructions but I keep getting this error message:
2009-11-25 20:16:09.258 Python[54047:d07] Error loading /Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: dlopen(/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain, 265): no suitable image found. Did find:
/Applications/RTMFetch 1.1/RTMKeychain.framework/RTMKeychain: no matching architecture in universal wrapper
Traceback (most recent call last):
File "rtmfetch.py", line 33, in
from RTMFetcher.RTMFetcher import RTMFetcher
File "/Applications/RTMFetch 1.1/RTMFetcher/RTMFetcher.py", line 41, in
objc.loadBundle('RTMKeychain', RTMKeychain.__dict__, bundle_path=os.path.join(os.path.dirname(__file__), '../RTMKeychain.framework'))
ImportError: Bundle could not be loaded
Any clues? (Apparently, I'm running Python 2.6.1.)
Thanks!

dws90 says:
@perezcarballo: You're using a different script than mine. I can't help you with that, other than suggesting that you give mine a shot (download in the first post).
The RTMFetch topic is:
https://www.rememberthemilk.com/forums/tips/7027/
The RTMFetch topic is:
https://www.rememberthemilk.com/forums/tips/7027/

hkma88 says:
I just downloaded your script and it seems to work nicely in terminal but when I put that same command in geektool, it doesn't want to work. It just shows a blank box.
Great script btw, I've been looking around for this.
Great script btw, I've been looking around for this.

david.bae says:
Hey I can't get it to access my RTM feed, it keeps saying, "Unable to access feed" does it matter which private RSS address I use in the script? I just used the RSS private script from my "All Tasks" Tab. Private Addresses are enabled, and I've tried resetting my private addresses and pasting the new URLs into the script but I'm still getting the same persistent error :[
But it seems like a great script, just wish I could get it to access my feeds ;[
But it seems like a great script, just wish I could get it to access my feeds ;[

david.bae says:
Nevermind fixed it, for those of you who may be having the same problem as me, change your RSS address, if you just directly copy and paste it, it will appear as
"feed://www.rememberthemilk.com/atom/..."
Change the "feed://"
to
"http://"
That fixed my problem :]
"feed://www.rememberthemilk.com/atom/..."
Change the "feed://"
to
"http://"
That fixed my problem :]

quirkydude says:
It's telling me the wrong date for everything. It's saying something is for Sunday, June 13, but its really for Monday, June 14. Any ideas?

dws90 says:
The script takes the date directly from the feed, so if the date's wrong, that implies that RTM is outputting the wrong date for some reason. Check the feed yourself (open the URL in your browser) and double-check that that is the case. If so, look at your RTM settings. Perhaps it's a timezone issue?

perezcarballo says:
Quick question. Is there away of not displaying due date when the due date is "never". I don't know anything about Python, but I gave it a shot and had this
if(task["due"] != "never"):
s = "%s" % (task["title"])
print s.encode("utf-8")
else:
s = "%s\n\t%s" % (task["title"], task["due"])
print s.encode("utf-8")
But it does not work. Does this make sense? Is there a quick fix?
Thanks!
if(task["due"] != "never"):
s = "%s" % (task["title"])
print s.encode("utf-8")
else:
s = "%s\n\t%s" % (task["title"], task["due"])
print s.encode("utf-8")
But it does not work. Does this make sense? Is there a quick fix?
Thanks!

perezcarballo says:
Oops. There was an indentation problem (among other little things). I sorted it out now.

drvillo says:
For what is worth, I've thrown a dirty patch for handling private feeds. Replacing the loadOnlineFeed() method with this one does the job:
---
def loadOnlineFeed(feedURL):
backupFilePath = CACHE_DIRECTORY + hashlib.md5(feedURL).hexdigest() + ".xml"
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(None, feedURL, username, password)
handler = urllib2.HTTPBasicAuthHandler(password_mgr)
opener = urllib2.build_opener(handler)
try:
feed = opener.open(feedURL).read()
createBackupFile(backupFilePath,feed)
except:
return False
return feed
---
(identation seems to be lost here, just ident it like the original one)
hope this helps
---
def loadOnlineFeed(feedURL):
backupFilePath = CACHE_DIRECTORY + hashlib.md5(feedURL).hexdigest() + ".xml"
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(None, feedURL, username, password)
handler = urllib2.HTTPBasicAuthHandler(password_mgr)
opener = urllib2.build_opener(handler)
try:
feed = opener.open(feedURL).read()
createBackupFile(backupFilePath,feed)
except:
return False
return feed
---
(identation seems to be lost here, just ident it like the original one)
hope this helps

plainclothes says:
this is fantastic ... but, I have to get to the web through a proxy.
I've got it all set up with my feeds. the result is "unable to access feed".
I assume it's my proxy getting in the way. true?
any solution? I'm no CLI pro and certainly not much of a Python developer.
I've got it all set up with my feeds. the result is "unable to access feed".
I assume it's my proxy getting in the way. true?
any solution? I'm no CLI pro and certainly not much of a Python developer.

mikesel says:
Thanks... Works perfectly!

billybow says:
hey any updates to this post or is there something better? I want my RTM things to be on my desktop but this script does not work, all it does is give me a blank screen.. Please help me someone!!!

eemeltoniv says:
Just picked this up -- works mostly quite well. I'm trying to recreat @perezcarballo's apparent success hiding "never" dates, though, without much success. Any assistance welcome.
Log in
to post a reply.