簡體   English   中英

Twitter API沒有響應整個推文

[英]Twitter API not responding with whole tweet

我正在創建一個Twitter API,但API沒有返回整個推文,它似乎在它們是推文中的鏈接時停止。 我正在使用PHP與TwitterAPIExchange.php,我該如何解決這個問題?

例:

Ingewikkelde antwoorden op vragen van @AgnesMulderCDA over dewawavlam van de #NAM。 De NAM hoeft pas in 11月t ... https://t.co/ZM0Tuk9AYv

應該是這樣的: https//twitter.com/SGaster/status/849334531907887104

$url = 'https://api.twitter.com/1.1/search/tweets.json';
$getfield = '?q=#kamerwatch';
$requestMethod = 'GET';

$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();

$print = (json_decode($response));
print_r($print);

在您的請求中添加tweet_mode=extended

例如:

上一個網址: https//api.twitter.com/1.1/statuses/user_timeline.json? screen_name = booty count = 50

正確的網址: https//api.twitter.com/1.1/statuses/user_timeline.json? screen_name = booty count = 50& tweet_mode = extended

並獲取文本使用full_text而不是text鍵。

更多細節 - > https://twittercommunity.com/t/truncated-text-and-media-entities-not-returned/74358

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM