0
votes

Disclaimer - Not a twitter user, and first time using the api.

The good - I'm able to use user_timeline to get back tweets from a screen name.

example - api.twitter.../user_timeline.json?screen_name=cnn&include_rts=1


The bad - The reponse doesn't list the tweet URL, but from the screen name and Id, I can recreate it.

example - twitter.com/cnn/status/512610874323116032


The ugly - For retweets, I don't see the retweet screen name, so I can't recreate a url to the tweet.

example - getting tweets for cnn may have a retweet like "CNN iReport @cnnireport"

From what I can tell, the user_timeline doesn't tell me that the tweet was from "cnnireport", so I don't know how to create the twitter.com/XXXXXXXXXXXXXX/status/512610874323116032 url.

Am I missing something basic? Seems like this would be a common scenario. Can somebody give me a dope slap and get me on track?

All advice is appreciated

1

1 Answers

0
votes

You can get the extended retweet information by making a request to statuses / retweets / :id.

So get the user timeline -

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=cnn&include_rts=true

then use the retweeted_status.id_str (ID) in the response and get -

https://api.twitter.com/1.1/statuses/retweets/ID.json