我正在尝试构建一个python程序来获取基于某个关键字的tweet。然而,虽然我可以成功地检索到tweets,但是它们会被截断。在
我怎样才能得到一条微博的全文?在
代码:(代码下面的示例输出) (python twitter模块)
import twitter
api = twitter.Api(consumer_key=CONSUMER_KEY,
consumer_secret=CONSUMER_SECRET,
access_token_key=ACCESS_TOKEN,
access_token_secret=ACCESS_SECRET)
results = api.GetSearch(term="car", since="2018-04-11", until="2018-04-12", count=5)
for twt in results:
tempTweet = (str(twt))
tweet = json.loads(tempTweet)
for key in tweet:
print(str(key) + ": " + str(tweet[key]))
print("#############################################")
样本输出:
^{pr2}$
初始化Api时只需传递
tweet_mode='extended'
。在这会打印出来
^{pr2}$相关问题 更多 >
编程相关推荐