1
我想流我自己的Twitter時間線與蟒蛇和tweepy和使用下面的代碼,但它只是打印我一些數字,我劑量打印我的時間線twitts。你可以幫我嗎?微博時間軸流媒體與tweepy
import tweepy
from tweepy import Stream
from tweepy.streaming import StreamListener
consumer_key = 'abc'
consumer_secret = 'abc'
access_token = 'abc'
access_secret = 'abc'
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
api = tweepy.API(auth)
class listener(StreamListener):
def on_data(self, data):
print (data)
return True
def on_error(self, status):
print (status)
twitterStream = Stream(auth, listener())
twitterStream.userstream(encoding='utf8')