本文整理汇总了Python中tweepy.Stream.filter(track=['wesleyan+lostandfound']andlocation<missing+')'>方法的典型用法代码示例。如果您正苦于以下问题:Python Stream.filter(track=['wesleyan+lostandfound']andlocation<missing+')'>方法的具体用法?Python Stream.filter(track=['wesleyan+lostandfound']andlocation<missing+')'>怎么用?Python Stream.filter(track=['wesleyan+lostandfound']andlocation<missing+')'>使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tweepy.Stream
的用法示例。
在下文中一共展示了Stream.filter(track=['wesleyan+lostandfound']andlocation<missing+')'>方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_error
# 需要导入模块: from tweepy import Stream [as 别名]
# 或者: from tweepy.Stream import filter(track=['wesleyan+lostandfound']andlocation<missing+')'> [as 别名]
return True
else:
return False
def on_error(self, status):
print (status)
#This handles Twitter authetification and the connection to Twitter Streaming API
l = StdOutListener()
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
stream = Stream(auth, l)
stream.filter(track=['wesleyan lostandfound'] and location = (41.6,72.7))
new_object = Deposit()
# loop = True
# while loop==True:
# tweets_file = open(tweets_data_path, "r")
# for line in tweets_file:
# try:
# tweet = json.loads(line)
# tweets_data.append(tweet)
# print (tweet['created_at'])
# except:
# continue