Skip to content

Instantly share code, notes, and snippets.

@simonw
Created December 7, 2009 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save simonw/251105 to your computer and use it in GitHub Desktop.
Save simonw/251105 to your computer and use it in GitHub Desktop.
A cow that can read Nat's 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