本文整理汇总了Python中twython.TwythonStreamer方法的典型用法代码示例。如果您正苦于以下问题:Python twython.TwythonStreamer方法的具体用法?Python twython.TwythonStreamer怎么用?Python twython.TwythonStreamer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twython
的用法示例。
在下文中一共展示了twython.TwythonStreamer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_success
# 需要导入模块: import twython [as 别名]
# 或者: from twython import TwythonStreamer [as 别名]
def on_success(self, data):
"""Called by TwythonStreamer when a message is received on the
underlying stream. Dispatches the message to all registered callbacks (in the
order they were registered) if the message is not a duplicate or show_dupes is
enabled."""
# Make sure this is a tweet we are interested in
if not self._filter_tweet(data):
return
# Remember this message - if we reach our store limit, pop the oldest
self._remember(data)
# Notify callbacks
for callback in self._callbacks:
callback(data)