I have made a simple Twitter API program that will loop through your Followers and grab all of them. It gets them by their IDs. How do I get their screen_name?
I know I have to do something with users/lookup with user_id as one of the parameters.
I have noticed what I think is my issue.
The JSON code that I am trying to get to goes something like this.
[
{
"screen_name": "twitter"
}
]
I have done it like (below.)
{
"screen_name": "twitter"
}
With the Lookup Function (https://dev.twitter.com/docs/api/1/get/users/lookup) it starts with the "[".
I was thinking I would have to do something like.
$LookUp_JSON->[1]->screen_name which would then print "twitter" but it's obviously not.
Check out the Twitter API console ( https://dev.twitter.com/console )
.. and hack it a little bit because its undocumented from the console standpoint.
Go to
users/show
where you'll see thishttp://api.twitter.com/1/users/show.json?screen_name={screen_name}
change it to this
http://api.twitter.com/1/users/show.json?user_id={id}
I.E for the ID of @TwitterAPI (6253282) this call
http://api.twitter.com/1/users/show.json?user_id=6253282
will get you this: