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
This program is free software: you can redistribute it and/or modify
8
8
it under the terms of the GNU General Public License as published by
@@ -145,7 +145,9 @@ $params = array(
145
145
$reply = $cb->users_show($params);
146
146
```
147
147
148
-
When **uploading files to Twitter**, the array syntax is obligatory:
148
+
### Uploading files to Twitter
149
+
150
+
The array syntax is obligatory:
149
151
150
152
```php
151
153
$params = array(
@@ -155,6 +157,44 @@ $params = array(
155
157
$reply = $cb->statuses_updateWithMedia($params);
156
158
```
157
159
160
+
#### Multiple images
161
+
can be uploaded in a 2-step process. **First** you send each image to Twitter, like this:
162
+
```php
163
+
// these files to upload
164
+
$media_files = array(
165
+
'bird1.jpg', 'bird2.jpg', 'bird3.jpg'
166
+
);
167
+
// will hold the uploaded IDs
168
+
$media_ids = array();
169
+
170
+
foreach ($media_files as $file) {
171
+
// upload all media files
172
+
$reply = $cb->media_upload(array(
173
+
'media' => $file
174
+
));
175
+
// and collect their IDs
176
+
$media_ids[] = $reply->media_id_string;
177
+
}
178
+
```
179
+
**Second,** you attach the collected media ids for all images to your call
180
+
to ```statuses/update```, like this:
181
+
182
+
```php
183
+
// convert media ids to string list
184
+
$media_ids = implode(',', $media_ids);
185
+
186
+
// send tweet with these medias
187
+
$reply = $cb->statuses_update(array(
188
+
'status' => 'These are some of my relatives.',
189
+
'media_ids' => $media_ids
190
+
));
191
+
print_r($reply);
192
+
);
193
+
```
194
+
Here is a [sample tweet](https://twitter.com/LarryMcTweet/status/475276535386365952) sent with the code above.
195
+
196
+
More [documentation for tweeting with multiple media](https://dev.twitter.com/docs/api/multiple-media-extended-entities) is available on the Twitter Developer site.
197
+
158
198
### Requests with app-only auth
159
199
160
200
To send API requests without an access token for a user (app-only auth),
@@ -211,6 +251,9 @@ rate-limited.
211
251
See the [Rate Limiting FAQ](https://dev.twitter.com/docs/rate-limiting-faq)
212
252
for more information.
213
253
254
+
Unless your return format is JOSN, you will receive rate-limiting details
255
+
in the returned data’s ```$reply->rate``` property.
256
+
214
257
6. Return formats
215
258
-----------------
216
259
The default return format for API calls is a PHP object.
@@ -388,3 +431,25 @@ User must verify login
388
431
When this error occurs, advise the user to
389
432
[generate a temporary password](https://twitter.com/settings/applications)
390
433
on twitter.com and use that to complete signing in to the application.
434
+
435
+
…know what cacert.pem is for?
436
+
-----------------------------
437
+
438
+
Connections to the Twitter API are done over a secured SSL connection.
439
+
Since 2.4.0, codebird-php checks if the Twitter API server has a valid
440
+
SSL certificate. Valid certificates have a correct signature-chain.
441
+
The cacert.pem file contains a list of all public certificates for root
442
+
certificate authorities. You can find more information about this file
443
+
at http://curl.haxx.se/docs/caextract.html.
444
+
445
+
…set the timeout for requests to the Twitter API?
446
+
-------------------------------------------------
447
+
448
+
For connecting to Twitter, Codebird uses the cURL library.
449
+
You can specify both the connection timeout and the request timeout,
0 commit comments