0

我已经使用了 twitter 搜索 API 并且还合并了extended_modeandfull_text属性,但我仍然从 API 中得到一个截断的字符串

这是我的代码:

results = t.search(q='tuberculosis', count=50, lang='en', result_type='popular',tweet_mode='extended')
all_tweets = results['statuses']

for tweet in all_tweets:
        tweetString = tweet["full_text"]
        userMentionList = tweet["entities"]["user_mentions"]
        if len(userMentionList)>0:
            for eachUserMention in userMentionList:
                name = eachUserMention["screen_name"]
                time = tweet["created_at"]
                wks.insert_rows(wks.rows, values=[tweetString, name, time], inherit=True)
    
4

1 回答 1

0

如果您使用的是 TwitterSearch,以下应该可以工作:

tso = TwitterSearchOrder()
tso.set_keywords('tuberculosis')
for tweet in ts.search_tweets_iterable(tso):
    print(tweet['text'])

你可以设置你想要的属性,比如语言和数量当然

于 2020-06-21T08:07:10.070 回答