Forums

Discuss all things Remember The Milk.

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.
Posted at 5:08am on October 7, 2009
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. :)
Posted 14 years ago
dws90 says:
Awesome. Thanks!
Posted 14 years ago
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).
Posted 14 years ago
(closed account) says:
Great, but fails at the first accent character :( (é,à, è, ...)
Posted 14 years ago
duane.hubbard says:
This also works great in Conky (linux). Thanks!
Posted 14 years ago
(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? :(
Posted 14 years ago
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 ^_^
Posted 14 years ago
(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
Posted 14 years ago
rplakas says:
I'm getting invaild syntax on line 84:

with open(path, "r") as f:
^

Posted 14 years ago
tahoo.tahooo says:
what shall i do after the terminal opens?
Posted 14 years ago
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.
Posted 14 years ago
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!
Posted 14 years ago
mle21 says:
The script still doesn't seem to be executable for me. Anyone else have this problem?
Posted 14 years ago
mle21 says:
...I'm still running 10.4.11, if that makes a difference.
Posted 14 years ago
(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
Posted 14 years ago
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.
Posted 14 years ago
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.
Posted 14 years ago
(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?
Posted 14 years ago
(closed account) says:
Of course, two seconds later I figured it out. Private addresses need to be turned on.
Posted 14 years ago
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)
Posted 14 years ago
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
Posted 14 years ago
zathraszero says:
Actually the ^ sits under the o in open in the out not quite like it has been shown above.
Posted 14 years ago
viewer says:
It now works flawlessly. Thanks dws90 for your responsiveness!
Posted 14 years ago
ethores says:
I'm getting the same error as @rplakas and @zathraszero. Bummer, this sounds really cool!
Posted 14 years ago
bmcquist says:
I also am getting the same error as zathraszero and rplakas...
Posted 14 years ago
spunkytofu says:
No errors, but the box is just blank.
Posted 14 years ago
bmcquist says:
try running the script in terminal, my box was blank as well...
Posted 14 years ago
spunkytofu says:
In terminal, it does nothing. Just prints the same line waiting for me to add another command.
Posted 14 years ago
xeophin says:
The new version works with accented characters – great, works perfectly. Thanks!
Posted 14 years ago
(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
Posted 14 years ago
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
Posted 14 years ago
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.
Posted 14 years ago
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!")
Posted 14 years ago
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.
Posted 14 years ago
bmcquist says:
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...?
Posted 14 years ago
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.
Posted 14 years ago
spunkytofu says:
Working now. Thanks.
Posted 14 years ago
c0debabe says:
Thanks for sharing!
Posted 14 years ago
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.
Posted 14 years ago
jinegao says:
yes
Posted 14 years ago
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 :-)
Posted 14 years ago
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!
Posted 14 years ago
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/
Posted 14 years ago
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.
Posted 14 years ago
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 ;[
Posted 14 years ago
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 :]
Posted 14 years ago
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?
Posted 13 years ago
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?
Posted 13 years ago
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!

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

Posted 13 years ago
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
Posted 13 years ago
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.
Posted 13 years ago
mikesel says:
Thanks... Works perfectly!
Posted 12 years ago
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!!!
Posted 11 years ago
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.
Posted 10 years ago
Log in to post a reply.