Skip to content

Instantly share code, notes, and snippets.

@2hands10fingers
Last active August 29, 2015 14:25
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 2hands10fingers/aed6624be89f315ab6d5 to your computer and use it in GitHub Desktop.
Save 2hands10fingers/aed6624be89f315ab6d5 to your computer and use it in GitHub Desktop.
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import time
ckey = 'Xwk45yibY06n7wHFHuoI2KVhi'
csecret = 'uWbOJZdRTmLDFKIxJKoR3huDwprOqefpwctEMIfE3gXfwruN5H'
atoken = '3096677539-t2d26ZLh1YbciYRub7TtGfEvrhF5MxhRTsNjuIb'
asecret = 'N4sSNMBw0TLG8yEwcGRAL15bSSeK1oO8SBZG63B8WiE9s'
""" class listener(StreamListener):
def on_dataa(self, data):
#print data
tweet = data.split(',"text":"')[1].split('","source')[0]
time.sleep(5)
print tweet
return True
def on_error(self, status):
print status """
midiDict = {'a':60, 'b':62}
class Listener(StreamListener):
def on_data (self, data):
tweet = data.split(',"text":"')[1].split('","Liksource')[0]
for letter in tweet:
number = ord(letter)
print (letter)
auth = OAuthHandler(ckey, csecret)
auth.set_access_token(atoken, asecret)
twitterStream = Stream(auth, Listener())
twitterStream.filter(track=["sad"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment