Newbie Using Api from J7mbo


#1

Hi !
I’m trying to get the last user image profile from a user which signed in my applications.I’m using the Twitter API for PHP from J7mbo. https://github.com/J7mbo/twitter-api-php

I can get somethings :

$url = 'https://api.twitter.com/1.1/users/show.json';
$getfield = '?screen_name=rwanitolp';
$requestMethod = 'GET';

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

But, in the result, in JSon, I haven’t what I want. I have only : “urls”:[]
But, I have an image in my profile. I want : profile_image_url_https.

An other question, to get this informations, I have to put just a username, my own. But, It would say that anybody can receive this informations ? So, The loggin ( with user key and app key ) is useless ??? No ?

I’m a newbie and it’s my first time in these APIs
And, sorry for my bad english :wink:

Thanks !


#2

It’s there, but it has it’s own key at the root level of the user object and is not within any of the urls values.

{
"id_str": "2848814415",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/771428163356356608/KG46xKLf_normal.jpg",
...
}

All requests to the Twitter API require authentication regardless of if they are accessing private or public data. In the case of public data it’s used for abuse protection and rate limiting.


#3

Thanks for your reply !
But, How Can I get this information ? Where is this level ? My url isn’t good ?
Because in the example result in the doc : https://dev.twitter.com/rest/reference/get/users/show, the example is very long ! Not like mine !

How to navigate in the result ?

Sorry if my questions may stupide…

Thanks !!!


#4

The response from Twitter should look very similar to the example on the GET users/show. Post the code you are using to process the response.


#5

Oh! I’ve found my error !
In my MySQL db, I saved my JSon in VarChar ( 500 ), but 500 is very less than the Json haves. Ok !

Thanks for your help !


#6