示例#1
0
文件: bot.py 项目: fumieval/lisabot3
def consume(name, responder):
    for status in streaming.iterstream(streaming.streamopen(name)):
        Execute(responder.action(status)).start()
示例#2
0
文件: bot.py 项目: fumieval/lisabot3
 def run(self):
     stream = streaming.streamopen(self.name, streaming.STATUSES_FILTER_URL, track="#Lisa_math_follow_me")
     for status in stream:
         self.api.createFriendship(user_id=status["user"]["id_str"])
         self.api.updateStatus(vocab.FOLLOW_COMPLETE.format(status["user"]["screen_name"]), in_reply_to_status_id=status["id_str"])