markovbot35.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:markovbot 作者: esdalmaijer 项目源码 文件源码
def _twitter_reconnect(self):

        """Logs in to Twitter, using the stored OAuth. This function is
        intended for internal use, and should ONLY be called after
        twitter_login has been called.
        """

        # Report the reconnection attempt.
        self._message(u'_twitter_reconnect', \
            u"Attempting to reconnect to Twitter.")

        # Raise an Exception if the twitter library wasn't imported
        if not IMPTWITTER:
            self._error(u'_twitter_reconnect', u"The 'twitter' library could not be imported. Check whether it is installed correctly.")

        # Log in to a Twitter account
        self._t = twitter.Twitter(auth=self._oauth)
        self._ts = twitter.TwitterStream(auth=self._oauth)
        self._loggedin = True

        # Get the bot's own user credentials
        self._credentials = self._t.account.verify_credentials()

        # Report the reconnection success.
        self._message(u'_twitter_reconnect', \
            u"Successfully reconnected to Twitter!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号