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