Streaming Twitter direct messages
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using the following code to stream direct messages received by my Twitter account -: from tweepy import Stream from tweepy import OAuthHandler from tweepy import API from tweepy . streaming import StreamListener # These values are appropriately filled in the code consumer_key = "" consumer_secret = "" access_token = "" access_token_secret = "" class StdOutListener ( StreamListener ): def __init__ ( self ): self . tweetCount = 0 def on_connect ( self ): print ( "Connection established!!" ) def on_disconnect ( self , notice ):