Twitter: re-enable timeline polling and display

this was commented out for no reason, it can be disabled simply by
unsetting output_channel
This commit is contained in:
Brian S. Stephan 2013-05-03 10:58:24 -05:00
parent 7322ebde8f
commit ccbea5ecdb
1 changed files with 14 additions and 16 deletions

View File

@ -126,22 +126,22 @@ class Twitter(Module):
if self.getstatusre.search(what):
return self.irc.reply(event, self.twitter_getstatus(event, nick,
userhost, what, admin_unlocked))
userhost, what, admin_unlocked))
elif self.getuserstatusre.search(what):
return self.irc.reply(event, self.twitter_getuserstatus(event, nick,
userhost, what, admin_unlocked))
userhost, what, admin_unlocked))
elif self.tweetre.search(what):
return self.irc.reply(event, self.twitter_tweet(event, nick,
userhost, what, admin_unlocked))
userhost, what, admin_unlocked))
elif self.replytore.search(what):
return self.irc.reply(event, self.twitter_replyto(event, nick,
userhost, what, admin_unlocked))
userhost, what, admin_unlocked))
elif self.gettokenre.search(what):
return self.irc.reply(event, self.twitter_gettoken(event, nick,
userhost, what, admin_unlocked))
userhost, what, admin_unlocked))
elif self.authre.search(what):
return self.irc.reply(event, self.twitter_auth(event, nick,
userhost, what, admin_unlocked))
userhost, what, admin_unlocked))
def twitter_getstatus(self, event, nick, userhost, what, admin_unlocked):
"""Get a status by tweet ID."""
@ -322,16 +322,14 @@ class Twitter(Module):
output_channel = self._get_output_channel()
if since_id is not None and output_channel != '':
# TODO: make this an option in the settings, just
# disabled in code for now
#tweets = self.twit.GetFriendsTimeline(since_id=since_id)
#tweets.reverse()
#for tweet in tweets:
# tweet_text = self._return_tweet_or_retweet_text(tweet=tweet, print_source=True)
# self.sendmsg(output_channel.encode('utf-8', 'ignore'), tweet_text)
#
## friends timeline printed, find the latest id
#new_since_id = self._get_latest_tweet_id(tweets, since_id)
tweets = self.twit.GetFriendsTimeline(since_id=since_id)
tweets.reverse()
for tweet in tweets:
tweet_text = self._return_tweet_or_retweet_text(tweet=tweet, print_source=True)
self.sendmsg(output_channel.encode('utf-8', 'ignore'), tweet_text)
# friends timeline printed, find the latest id
new_since_id = self._get_latest_tweet_id(tweets, since_id)
tweets = self.twit.GetMentions(since_id=since_id)
tweets.reverse()