Skip to content

Instantly share code, notes, and snippets.

@xtat
Created August 30, 2009 04:46
Show Gist options
  • Save xtat/177859 to your computer and use it in GitHub Desktop.
Save xtat/177859 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
from tweetstream import ReconnectingTweetStream
import pprint
import os
USER = "your user"
PASSWD = "your password"
FOXPATH = "~/firefox3.5/firefox/firefox %s"
ts = ReconnectingTweetStream(USER, PASSWD, url="gardenhose")
for tweet in ts:
if tweet.has_key('user'):
#print "<%s>\t%s" % (tweet['user']['screen_name'], tweet['text'])
idx = tweet['text'].find('http://')
if idx != -1:
url = tweet['text'][idx:]
print url
os.system(FOXPATH % (url))
else:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment