DEBUG log when we get a tweet from a stream
This commit is contained in:
parent
1e30e76cad
commit
6a3af7f496
1 changed files with 4 additions and 0 deletions
|
@ -14,6 +14,7 @@ import tweepy
|
||||||
_bot = None
|
_bot = None
|
||||||
_events = None
|
_events = None
|
||||||
_exports = None
|
_exports = None
|
||||||
|
_log = None
|
||||||
|
|
||||||
REGEX_TWITTERURL = re.compile(
|
REGEX_TWITTERURL = re.compile(
|
||||||
"https?://(?:www\.)?twitter.com/[^/]+/status/(\d+)", re.I)
|
"https?://(?:www\.)?twitter.com/[^/]+/status/(\d+)", re.I)
|
||||||
|
@ -25,6 +26,7 @@ class BitBotStreamListener(tweepy.StreamListener):
|
||||||
def on_status(self, status):
|
def on_status(self, status):
|
||||||
_bot.trigger(lambda: self._on_status(status))
|
_bot.trigger(lambda: self._on_status(status))
|
||||||
def _on_status(self, status):
|
def _on_status(self, status):
|
||||||
|
_log.debug("Got tweet from stream: %s", [status])
|
||||||
given_username = status.user.screen_name.lower()
|
given_username = status.user.screen_name.lower()
|
||||||
|
|
||||||
follows = []
|
follows = []
|
||||||
|
@ -51,9 +53,11 @@ class Module(ModuleManager.BaseModule):
|
||||||
global _bot
|
global _bot
|
||||||
global _events
|
global _events
|
||||||
global _exports
|
global _exports
|
||||||
|
global _log
|
||||||
_bot = self.bot
|
_bot = self.bot
|
||||||
_events = self.events
|
_events = self.events
|
||||||
_exports = self.exports
|
_exports = self.exports
|
||||||
|
_log = self.log
|
||||||
self._start_stream()
|
self._start_stream()
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
|
|
Loading…
Reference in a new issue