| Welcome! | English (US) ![]() |
| Welcome! | English (US) ![]() |
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
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 at 12:37pm on October 20, 2009
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 at 4:39pm on October 20, 2009
says:Great, but fails at the first accent character :( (é,à, è, ...)
Posted at 4:41pm on October 20, 2009
This also works great in Conky (linux). Thanks!
Posted at 5:04pm on October 20, 2009
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 at 11:10am on October 21, 2009
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 at 11:28am on October 21, 2009
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 at 1:44pm on October 21, 2009
I'm getting invaild syntax on line 84:
with open(path, "r") as f:
^
Posted at 3:00pm on October 21, 2009
what shall i do after the terminal opens?
Posted at 3:42pm on October 21, 2009
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 at 3:52pm on October 21, 2009
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 at 3:56pm on October 21, 2009
The script still doesn't seem to be executable for me. Anyone else have this problem?
Posted at 5:03pm on October 21, 2009
...I'm still running 10.4.11, if that makes a difference.
Posted at 5:16pm on October 21, 2009
@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 at 10:21am on October 22, 2009
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 at 12:49pm on October 22, 2009
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 at 3:26pm on October 22, 2009
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 at 7:55pm on October 22, 2009
says:Of course, two seconds later I figured it out. Private addresses need to be turned on.
Posted at 8:01pm on October 22, 2009
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 at 9:12pm on October 22, 2009
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 at 1:05am on October 23, 2009
says:Actually the ^ sits under the o in open in the out not quite like it has been shown above.
Posted at 1:06am on October 23, 2009
It now works flawlessly. Thanks dws90 for your responsiveness!
Posted at 1:03pm on October 23, 2009
says:I'm getting the same error as @rplakas and @zathraszero. Bummer, this sounds really cool!
Posted at 10:22pm on October 23, 2009
says:I also am getting the same error as zathraszero and rplakas...
Posted at 11:06pm on October 23, 2009
No errors, but the box is just blank.
Posted at 12:26am on October 24, 2009
says:try running the script in terminal, my box was blank as well...
Posted at 3:09am on October 24, 2009
In terminal, it does nothing. Just prints the same line waiting for me to add another command.
Posted at 5:11am on October 24, 2009
says:The new version works with accented characters – great, works perfectly. Thanks!
Posted at 9:32am on October 24, 2009
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 at 4:34pm on October 24, 2009
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 at 3:56am on October 25, 2009
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 at 12:34pm on October 25, 2009
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 at 11:26pm on October 25, 2009
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 at 12:35am on October 26, 2009
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 at 3:03am on October 26, 2009
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 at 1:59am on October 27, 2009
Working now. Thanks.
Posted at 7:44pm on October 27, 2009
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 at 4:35pm on November 1, 2009
yes
Posted at 4:54am on November 11, 2009
@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 at 12:31am on November 17, 2009