Last active
August 29, 2015 14:25
-
-
Save 2hands10fingers/aed6624be89f315ab6d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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