def consume(name, responder): for status in streaming.iterstream(streaming.streamopen(name)): Execute(responder.action(status)).start()
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"])