Re-tweets clipped by API 1.1?


#1

Hi I have been putting together a twitter feed for a client that will collect their tweets and retweets using OAuth and the REST API v1.1. I am using CURL and then JSON to collect the data to then be processed and displayed by javascript/jquery. However when I study just exactly what is coming through in the raw data that CURL is retrieving, I find there seems to be an issue with the retweets.

The tweets are coming through fine and most of the re-tweets are coming through OK too. The problem is with some of the longer retweets. Whilst all the retweets seem to come through fine on their twitter page/account, it is a different matter when it comes to the feed from the API.

The API (at least I think it is the API) seems to be adding (or re-prepending) the “RT @username [and then IF the person they are retweeting has a tweet more than 140 characters]” the API collects the data and it is then clipping the retweet of the last 15-20 characters and putting in a “…” at the end of the tweet. This seems to correspond to the number of characters in the username + the @ symbol and spaces. So the API seems to be counting the “RT @username” as part of the 140 characters and then disallowing the rest of the (re)tweet.

I admittedly am not an expert in the rules of retweeting and if there are any specifications that the API follows that are different than normal tweets.

Am I correct in my understanding of what is happening?

Is this a limitation that I can’t control? ie - Can I control the RT @ or am I barking up the wrong tree here and misunderstanding something?

Thanks in advance for any help and/or advice.


#2

If you have a look at the JSON object of a retweeted tweet, you’ll see a key called retweeted_status; this is information on the original tweet, including the un-truncated tweet content itself. You can then, if you wish, use the screen_name value inside retweeted_status to prepend RT @ to the front of the un-truncated tweet.

Hope that helps.


#3

Thanks Matt. I guess I didn’t look very hard through the raw data. It was there in the end, I should have hit ctrl-g one more time and I would have found the un-truncated tweet. Thanks again.