Skip to content

Commit 02c8e94

Browse files
committed
Deprecate statuses/update_with_media, update README
1 parent a69e554 commit 02c8e94

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

README.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -272,26 +272,11 @@ cb.__call(
272272
);
273273
```
274274

275-
### Uploading files to Twitter
275+
### Uploading media to Twitter
276276

277-
The array syntax is obligatory, and the media have to be base64-encoded:
277+
Tweet media can be uploaded in a 2-step process, and the media have to be
278+
base64-encoded. **First** you send each image to Twitter, like this:
278279

279-
```javascript
280-
var params = {
281-
"status": "The bird is flying high. #larry",
282-
"media[]": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB+0lEQVR42mP8//8/Ay0BEwONwagFoxZQDljI0PP8x7/Z93/e+PxXmpMpXp5dh4+ZgYHh0bd/clxYnMuINaMtfvRLgp3RVZwVU+rkuz+eRz+//wXVxcrEkKnEceXTX0dRlhoNTmKDaOvzXwHHv6x9+gtN/M9/hpjTX+GmMzAw/P7HMOnOj+ff//35x/Ds+z9iLfjPwPDt7//QE1/Sz319/RNh3PkPf+58+Yup/t7Xf9p8zFKcTMRa4CLGCrFm1v2fSjs+pJ/7uuvl7w+//yO7HRkUq3GEyrCREMk+kqy2IiyH3/xhYGD48uf/rPs/Z93/yczIwM3CiFU9Hw5xnD4ouvTt4Tf0AP37n+HTb+w+UOBmIs2CICm2R9/+EZlqGRkYzIVYSLMgRIYtUYGdSAsMBFgUuJhIy2iMDAwt2pysjAwLHv78RcgnOcrs5BQVHEyMG579Imi6Nh9zrBxZFgixMW624pXnwldYcTAzLjDhZmUit7AzE2K54c7fp8eF1QhWRobFptwmgiwkF3b//jMwMjJ8+P3/zPs/yx/9Wvr412+MgBJlZ1xsyuOOrbAibMHH3/87b32fce/nR2ypnpuFMVGevU6TQ5SdqKKeEVez5cuf/7te/j727s+9L/++/v3PzcyowM1kIcTiLs7Kz8pIfNnOONouGrVg1AIGAJ6gvN4J6V9GAAAAAElFTkSuQmCC"
283-
);
284-
cb.__call(
285-
"statuses_updateWithMedia",
286-
params,
287-
function (reply) {
288-
// ...
289-
}
290-
);
291-
```
292-
293-
#### Multiple images
294-
can be uploaded in a 2-step process. **First** you send each image to Twitter, like this:
295280
```javascript
296281
var params = {
297282
"media": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB+0lEQVR42mP8//8/Ay0BEwONwagFoxZQDljI0PP8x7/Z93/e+PxXmpMpXp5dh4+ZgYHh0bd/clxYnMuINaMtfvRLgp3RVZwVU+rkuz+eRz+//wXVxcrEkKnEceXTX0dRlhoNTmKDaOvzXwHHv6x9+gtN/M9/hpjTX+GmMzAw/P7HMOnOj+ff//35x/Ds+z9iLfjPwPDt7//QE1/Sz319/RNh3PkPf+58+Yup/t7Xf9p8zFKcTMRa4CLGCrFm1v2fSjs+pJ/7uuvl7w+//yO7HRkUq3GEyrCREMk+kqy2IiyH3/xhYGD48uf/rPs/Z93/yczIwM3CiFU9Hw5xnD4ouvTt4Tf0AP37n+HTb+w+UOBmIs2CICm2R9/+EZlqGRkYzIVYSLMgRIYtUYGdSAsMBFgUuJhIy2iMDAwt2pysjAwLHv78RcgnOcrs5BQVHEyMG579Imi6Nh9zrBxZFgixMW624pXnwldYcTAzLjDhZmUit7AzE2K54c7fp8eF1QhWRobFptwmgiwkF3b//jMwMjJ8+P3/zPs/yx/9Wvr412+MgBJlZ1xsyuOOrbAibMHH3/87b32fce/nR2ypnpuFMVGevU6TQ5SdqKKeEVez5cuf/7te/j727s+9L/++/v3PzcyowM1kIcTiLs7Kz8pIfNnOONouGrVg1AIGAJ6gvN4J6V9GAAAAAElFTkSuQmCC"
@@ -303,10 +288,11 @@ cb.__call(
303288
// you get a media id back:
304289
console.log(reply.media_id_string);
305290

306-
// continue upload of 2nd image here
291+
// continue upload of 2nd image here, if any (just 1 image works, too!)
307292
}
308293
);
309294
```
295+
310296
**Second,** you attach the collected media ids for all images to your call
311297
to ```statuses/update```, like this:
312298
@@ -323,7 +309,7 @@ cb.__call(
323309
);
324310
```
325311
326-
More [documentation for tweeting with multiple media](https://dev.twitter.com/docs/api/multiple-media-extended-entities) is available on the Twitter Developer site.
312+
More [documentation for tweeting with media](https://dev.twitter.com/rest/public/uploading-media-multiple-photos) is available on the Twitter Developer site.
327313
328314
### Requests with app-only auth
329315
@@ -385,7 +371,7 @@ The library returns the response HTTP status code, so you can detect rate limits
385371
I suggest you to check if the ```reply.httpstatus``` property is ```400```
386372
and check with the Twitter API to find out if you are currently being
387373
rate-limited.
388-
See the [Rate Limiting FAQ](https://dev.twitter.com/docs/rate-limiting-faq)
374+
See the [Rate Limiting FAQ](https://dev.twitter.com/rest/public/rate-limiting)
389375
for more information.
390376
391377
If you allow your callback function to accept a second parameter,

codebird.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ var Codebird = function () {
442442
"statuses/lookup",
443443
"statuses/retweet/:id",
444444
"statuses/update",
445-
"statuses/update_with_media",
445+
"statuses/update_with_media", // deprecated, use media/upload
446446
"users/lookup",
447447
"users/report_spam",
448448

0 commit comments

Comments
 (0)