twitter.py 文件源码

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

项目:TwitterStockMonitor 作者: semaaJ 项目源码 文件源码
def share_output(self):
        """Calls difference_in_shares from the Companies module,
            Outputs the data to twitter."""

        share_dict = company.get_company_dict()

        for comp in share_dict:
            try:
                self.api.update_status(
                    f'Since {share_dict[comp]["handle"]} mentioned {comp.upper()}, {share_dict[comp]["day"]} days ago, '
                    f'their shares have changed from {share_dict[comp]["initialSharePrice"]:.2f} to '
                    f"{share_dict[comp]['currentSharePrice']:} that's a {share_dict[comp]['shareChange']:.3f}% change!"
                    )

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


问题


面经


文章

微信
公众号

扫码关注公众号