本文整理汇总了Python中twitter.Twitter.get_tweet_link方法的典型用法代码示例。如果您正苦于以下问题:Python Twitter.get_tweet_link方法的具体用法?Python Twitter.get_tweet_link怎么用?Python Twitter.get_tweet_link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.Twitter
的用法示例。
在下文中一共展示了Twitter.get_tweet_link方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Twitter
# 需要导入模块: from twitter import Twitter [as 别名]
# 或者: from twitter.Twitter import get_tweet_link [as 别名]
twitter = Twitter(logs_to_cloud=False)
# Look up the metadata for the tweets.
tweets = twitter.get_tweets(SINCE_TWEET_ID)
events = []
for tweet in tqdm(tweets):
event = {}
timestamp_str = tweet["created_at"]
timestamp = trading.utc_to_market_time(datetime.strptime(
timestamp_str, "%a %b %d %H:%M:%S +0000 %Y"))
text = twitter.get_tweet_text(tweet)
event["timestamp"] = timestamp
event["text"] = text
event["link"] = twitter.get_tweet_link(tweet)
# Extract the companies.
companies = analysis.find_companies(tweet)
strategies = []
for company in companies:
# What would have been the strategy?
market_status = get_market_status(timestamp)
strategy = trading.get_strategy(company, market_status)
# What was the price at tweet and at EOD?
price = trading.get_historical_prices(
company["ticker"], timestamp)
if price: