I have GeekTool for Lion and am trying to run the Glet located at - http://www.macosxtips.co.uk/geeklets/messaging/latest-tweet-1/
On my system. It's just not working. The same code is running perfect in terminal and IDLE, but GeekTool is not processing it. I thought it might be a problem with Geektool and Python, but another python script, used to pull the latest XKCD is working perfect on GeekTool (http://code.google.com/p/geektool-xkcd/source/browse/trunk/xkcd.py)
I thought it must be a problem with indentation etc but that's not the case. I've brought the code down to the following, it works in terminal but not with Geektool -
#!/usr/bin/env python
import tweepy
CONSUMER_KEY = '...'
CONSUMER_SECRET = '...'
ACCESS_KEY = '...'
ACCESS_SECRET = '...'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
tested = api.home_timeline()
for result in tested:
print result.text + '\n' + '\n- ' + result.user.screen_name
break
I'm not sure at all what the issue is. How do I know that the code is not working? I added the Display Status feedback message icon on the GLet. It keeps glowing red (while the XKCD one is green). If I change the command in the same GLet to something simple like - echo "hello" or python -c print "Hello" then it works fine (glows green, shows output) but as soon as I change it back to the old one, problem!
Also, another doubt - the python -c print command doesn't print anything in the terminal. What's the issue with that? Can someone else please run it and tell me how to print in terminal using python?