8000 Merge branch 'master' of github.com:mynetx/codebird-php · rsaeed/codebird-php@f62ebe4 · GitHub
[go: up one dir, main page]

Skip to content

Commit f62ebe4

Browse files
committed
Merge branch 'master' of github.com:mynetx/codebird-php
8000
2 parents 04069f8 + a4a5d34 commit f62ebe4

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

README.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -246,28 +246,19 @@ How Do I…?
246246
…access a user’s profile image?
247247
-------------------------------
248248

249-
The Twitter API usually contains data in either JSON or XML. However, the
250-
templated method ```users/profile_image/:screen_name``` uses a HTTP 302 redirect
251-
to send you to the requested image file URL.
249+
First retrieve the user object using
252250

253-
Codebird intercepts this HTTP redirect and extracts the profile image URL instead.
254-
Thus, the following API call:
251+
```$reply = $cb->users_show("screen_name=$username");```
255252

256-
```php
257-
$reply = $cb->users_profileImage_SCREEN_NAME('screen_name=mynetx&size=mini');
258-
```
259253

260-
returns an object with the following contents:
261-
```
262-
stdClass Object
263-
(
264-
[profile_image_url_https] => https://si0.twimg.com/profile_images/1417135246/Blue_Purple.96_mini.png
265-
[httpstatus] => 302
266-
)
267-
```
254+
with ```$username``` being the username of the account you wish to retrieve the profile image from.
255+
256+
Then get the value from the index ```profile_image_url``` or ```profile_image_url_https``` of the user object previously retrieved.
257+
258+
259+
For example:
268260

269-
You can find out how to build the Codebird method name, in the section
270-
‘Mapping API methods to Codebird function calls.’
261+
```$reply['profile_image_url']``` will then return the profile image url without https.
271262

272263
…get user ID, screen name and more details about the current user?
273264
------------------------------------------------------------------

0 commit comments

Comments
 (0)
0