Bot.py 文件源码

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

项目:MyTwitterBot 作者: felipessalvatore 项目源码 文件源码
def __init__(self,
                 corpus,
                 friends=[],
                 commentary="None",
                 black_list=[],
                 local="world",
                 hashtag_search=None):
        self.black_list = black_list
        self.local = local
        self.friends = friends
        self.corpus = corpus
        auth = tweepy.OAuthHandler(ConsumerKey, ConsumerSecret)
        auth.set_access_token(AccessToken, AccessTokenSecret)
        self.api = tweepy.API(auth)
        entry = [("Date", [get_date()]),
                 ("Followers", [len(self.api.followers_ids())]),
                 ("Following", [len(self.api.friends_ids())]),
                 ("Commentary", [commentary])]
        self.df = pd.DataFrame.from_items(entry)
        self.log()
        if hashtag_search is None:
            self.hashtag_search = self.get_trends(self.local)
        else:
            self.hashtag_search = hashtag_search + self.get_trends(self.local)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号