andrewbiggart/latest-tweets-php-o-auth

Tweets are truncated

Opened this issue · 2 comments

If a tweet is above a certain character count the tweet becomes truncated and adds '...' to the end. Is it possible to display all the tweet?

@ciarangaffey I recently came across this issue myself.

To fix it i updated line 103 to

$get_tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitter_user_id."&count=".$tweets_to_display."&include_rts=".$include_rts."&exclude_replies=".$ignore_replies"&tweet_mode=extended");

Note the extra &tweet_mode=extended at the end.

Then i replaced line 122

$tweet_desc = $tweet->text;

with

if ( $tweet->truncated == 'false' ) { $tweet_desc = $tweet->text; } else { $tweet_desc = $tweet->full_text; }

It looks as though Twitter changed a few things since i applied my fix. Simply changing line 103 to include the extended tweet mode and replacing line 122 with

$tweet_desc = $tweet->full_text;

Should be enough.