【问题标题】:How to get full text in Twitter search API?如何在 Twitter 搜索 API 中获取全文?
【发布时间】:2020-10-11 04:49:09
【问题描述】:

我使用了 twitter 搜索 API,并且还合并了 extended_modefull_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)
    

【问题讨论】:

    标签: python json twitter tweepy twitterapi-python


    【解决方案1】:

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

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

    您当然可以设置所需的属性,例如语言和计数

    【讨论】:

    • 我还没有尝试过你的,但是这条推文被截断,只为了转发
    猜你喜欢
    • 2018-05-26
    • 2018-03-15
    • 1970-01-01
    • 1970-01-01
    • 2017-08-15
    • 2020-08-19
    • 2013-05-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多