twitter.py 文件源码

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

项目:TwitterStockMonitor 作者: semaaJ 项目源码 文件源码
def initial_tweet(self, matches):
        """Tweets when a company is mentioned, along with it's sentiment."""

        sentiment = self.sentiment_analysis()
        sentiment_dict = {"positive": u"\U00002705",
                          "negative": u"\U0000274E",
                          "neutral": u"\U00002796"
                          }

        for comp in matches:
            try:
                self.api.update_status(f'{self.handle} just mentioned {comp.upper()} {sentiment}ly '
                                       f'in their latest tweet! '
                                       f'https://twitter.com/{self.handle}/status/{self.tweet_id}')

            except tweepy.TweepError as error:
                logging.debug(error)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号