Skip to content

Instantly share code, notes, and snippets.

@cmheisel
Forked from simonw/natread.py
Created December 7, 2009 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmheisel/251136 to your computer and use it in GitHub Desktop.
Save cmheisel/251136 to your computer and use it in GitHub Desktop.
A cow that can read any (public) users mind
#!/usr/bin/python
import json, urllib, os, textwrap
user = 'natbat'
url = "http://twitter.com/statuses/user_timeline/%s.json"
pipe = os.popen("cowthink -n", 'w')
pipe.write('\n'.join(textwrap.wrap(
json.load(urllib.urlopen(url % user))[0]['text'])
))
pipe.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment