You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get profile image. I couldn't find an example in library.
So i used this code:
$params = array( 'screen_name' => $scrName );
$code = $tmhOAuth->request('GET', $tmhOAuth->url('1/users/profile_image') , $params);
But the output is as follows:
< html > < body >You are being redirected.< /body >< /html >
Is it possible to fetch image link by tmhOAuth library?
The text was updated successfully, but these errors were encountered:
The profile image URL is located in the user object and it's generally better to get it through /1/users/lookup instead.
(https://dev.twitter.com/docs/api/1/get/users/lookup).
But, to answer your question, the Twitter API documentation for https://dev.twitter.com/docs/api/1/get/users/profile_image/%3Ascreen_name says This resource does not return JSON or XML, but instead returns a 302 redirect to the actual image resource.. This means you need to look at the headers of $tmhOAuth response to get the profile image URL.
If you wish to use $tmhOAuth as the way to get these images for caching you can do something like this:
I'm trying to get profile image. I couldn't find an example in library.
So i used this code:
$params = array( 'screen_name' => $scrName );
$code = $tmhOAuth->request('GET', $tmhOAuth->url('1/users/profile_image') , $params);
But the output is as follows:
< html > < body >You are being redirected.< /body >< /html >
Is it possible to fetch image link by tmhOAuth library?
The text was updated successfully, but these errors were encountered: