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)
评论列表
文章目录