I built a very simple script with PRAW that prints the top 10 link titles on reddit.com/r/worldnews. I want this to work with GeekTool, but only the following shows up:
"TOP 10 NEWS ON REDDIT
1 NEWS TITLE
2 "
I don't know why that happens since when running the script directly from the command line I have no issues whatsoever.
Here's the python script:
import praw
def main():
subreddit = r.get_subreddit('worldnews')
x = 1
print "TOP 10 NEWS ON REDDIT"
print ''
for submission in subreddit.get_hot(limit=10):
print x, submission.title
x = x+1
print ' '
if __name__ == "__main__":
user_agent = "Top10 0.1 by /u/alexisfg"
r = praw.Reddit(user_agent=user_agent)
main()