From 1aaed7e7cd0c29761cf9a2999658a400d3553e1a Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 24 Jun 2014 18:49:12 +0200 Subject: [PATCH 01/14] Set version to 2.6.0-dev --- CHANGELOG | 2 ++ bower.json | 2 +- codebird.js | 4 ++-- package.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 262e046..e469261 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ codebird-js - changelog ======================= +2.6.0 (not yet released) + 2.5.0 (2014-06-23) + #24 Add README section about xAuth + #46 Don't force to send base64 media uploads via proxy diff --git a/bower.json b/bower.json index 895177a..cb6aa2a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "codebird-js", - "version": "2.5.0", + "version": "2.6.0-dev", "homepage": "http://www.jublo.net/projects/codebird/js", "authors": [ "Joshua Atkins ", diff --git a/codebird.js b/codebird.js index 114ac77..50827d1 100644 --- a/codebird.js +++ b/codebird.js @@ -2,7 +2,7 @@ * A Twitter library in JavaScript * * @package codebird - * @version 2.5.0 + * @version 2.6.0-dev * @author Jublo Solutions * @copyright 2010-2014 Jublo Solutions * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 @@ -135,7 +135,7 @@ var Codebird = function () { /** * The current Codebird version */ - var _version = "2.5.0"; + var _version = "2.6.0-dev"; /** * Sets the OAuth consumer key and secret (App key) diff --git a/package.json b/package.json index d771ce3..8f9489f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codebird", - "version": "2.5.0", + "version": "2.6.0-dev", "description": "A Twitter library in JavaScript.", "keywords": [ "Twitter", From f47ecd24f6f64ae482f238c1ffc59ee5050f4757 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 24 Jun 2014 18:53:41 +0200 Subject: [PATCH 02/14] Add public getApiMethods() method --- codebird.js | 395 +++++++++++++++++++++++++++------------------------- 1 file changed, 204 insertions(+), 191 deletions(-) diff --git a/codebird.js b/codebird.js index 50827d1..ed7dc09 100644 --- a/codebird.js +++ b/codebird.js @@ -308,6 +308,206 @@ var Codebird = function () { } }; + /** + * Get allowed API methods, sorted by GET or POST + * Watch out for multiple-method "account/settings"! + * + * @return array $apimethods + */ + var getApiMethods = function () { + var httpmethods = { + GET: [ + // Timelines + "statuses/mentions_timeline", + "statuses/user_timeline", + "statuses/home_timeline", + "statuses/retweets_of_me", + + // Tweets + "statuses/retweets/:id", + "statuses/show/:id", + "statuses/oembed", + "statuses/retweeters/ids", + + // Search + "search/tweets", + + // Direct Messages + "direct_messages", + "direct_messages/sent", + "direct_messages/show", + + // Friends & Followers + "friendships/no_retweets/ids", + "friends/ids", + "followers/ids", + "friendships/lookup", + "friendships/incoming", + "friendships/outgoing", + "friendships/show", + "friends/list", + "followers/list", + "friendships/lookup", + + // Users + "account/settings", + "account/verify_credentials", + "blocks/list", + "blocks/ids", + "users/lookup", + "users/show", + "users/search", + "users/contributees", + "users/contributors", + "users/profile_banner", + "mutes/users/ids", + "mutes/users/list", + + // Suggested Users + "users/suggestions/:slug", + "users/suggestions", + "users/suggestions/:slug/members", + + // Favorites + "favorites/list", + + // Lists + "lists/list", + "lists/statuses", + "lists/memberships", + "lists/subscribers", + "lists/subscribers/show", + "lists/members/show", + "lists/members", + "lists/show", + "lists/subscriptions", + "lists/ownerships", + + // Saved searches + "saved_searches/list", + "saved_searches/show/:id", + + // Places & Geo + "geo/id/:place_id", + "geo/reverse_geocode", + "geo/search", + "geo/similar_places", + + // Trends + "trends/place", + "trends/available", + "trends/closest", + + // OAuth + "oauth/authenticate", + "oauth/authorize", + + // Help + "help/configuration", + "help/languages", + "help/privacy", + "help/tos", + "application/rate_limit_status", + + // Tweets + "statuses/lookup", + + // Internal + "users/recommendations", + "account/push_destinations/device", + "activity/about_me", + "activity/by_friends", + "statuses/media_timeline", + "timeline/home", + "help/experiments", + "search/typeahead", + "search/universal", + "discover/universal", + "conversation/show", + "statuses/:id/activity/summary", + "account/login_verification_enrollment", + "account/login_verification_request", + "prompts/suggest", + + "beta/timelines/custom/list", + "beta/timelines/timeline", + "beta/timelines/custom/show" + ], + POST: [ + // Tweets + "statuses/destroy/:id", + "statuses/update", + "statuses/retweet/:id", + "statuses/update_with_media", + "media/upload", + + // Direct Messages + "direct_messages/destroy", + "direct_messages/new", + + // Friends & Followers + "friendships/create", + "friendships/destroy", + "friendships/update", + + // Users + "account/settings__post", + "account/update_delivery_device", + "account/update_profile", + "account/update_profile_background_image", + "account/update_profile_colors", + "account/update_profile_image", + "blocks/create", + "blocks/destroy", + "account/update_profile_banner", + "account/remove_profile_banner", + "mutes/users/create", + "mutes/users/destroy", + + // Favorites + "favorites/destroy", + "favorites/create", + + // Lists + "lists/members/destroy", + "lists/subscribers/create", + "lists/subscribers/destroy", + "lists/members/create_all", + "lists/members/create", + "lists/destroy", + "lists/update", + "lists/create", + "lists/members/destroy_all", + + // Saved Searches + "saved_searches/create", + "saved_searches/destroy/:id", + + // Spam Reporting + "users/report_spam", + + // OAuth + "oauth/access_token", + "oauth/request_token", + "oauth2/token", + "oauth2/invalidate_token", + + // Internal + "direct_messages/read", + "account/login_verification_enrollment__post", + "push_destinations/enable_login_verification", + "account/login_verification_request__post", + + "beta/timelines/custom/create", + "beta/timelines/custom/update", + "beta/timelines/custom/destroy", + "beta/timelines/custom/add", + "beta/timelines/custom/remove" + ] + }; + return httpmethods; + }; + /** * Main API handler working on any requests you issue * @@ -904,197 +1104,9 @@ var Codebird = function () { break; } - var httpmethods = {}; - httpmethods.GET = [ - // Timelines - "statuses/mentions_timeline", - "statuses/user_timeline", - "statuses/home_timeline", - "statuses/retweets_of_me", - - // Tweets - "statuses/retweets/:id", - "statuses/show/:id", - "statuses/oembed", - "statuses/retweeters/ids", - - // Search - "search/tweets", - - // Direct Messages - "direct_messages", - "direct_messages/sent", - "direct_messages/show", - - // Friends & Followers - "friendships/no_retweets/ids", - "friends/ids", - "followers/ids", - "friendships/lookup", - "friendships/incoming", - "friendships/outgoing", - "friendships/show", - "friends/list", - "followers/list", - "friendships/lookup", - - // Users - "account/settings", - "account/verify_credentials", - "blocks/list", - "blocks/ids", - "users/lookup", - "users/show", - "users/search", - "users/contributees", - "users/contributors", - "users/profile_banner", - "mutes/users/ids", - "mutes/users/list", - - // Suggested Users - "users/suggestions/:slug", - "users/suggestions", - "users/suggestions/:slug/members", - - // Favorites - "favorites/list", - - // Lists - "lists/list", - "lists/statuses", - "lists/memberships", - "lists/subscribers", - "lists/subscribers/show", - "lists/members/show", - "lists/members", - "lists/show", - "lists/subscriptions", - "lists/ownerships", - - // Saved searches - "saved_searches/list", - "saved_searches/show/:id", - - // Places & Geo - "geo/id/:place_id", - "geo/reverse_geocode", - "geo/search", - "geo/similar_places", - - // Trends - "trends/place", - "trends/available", - "trends/closest", - - // OAuth - "oauth/authenticate", - "oauth/authorize", - - // Help - "help/configuration", - "help/languages", - "help/privacy", - "help/tos", - "application/rate_limit_status", - - // Tweets - "statuses/lookup", - - // Internal - "users/recommendations", - "account/push_destinations/device", - "activity/about_me", - "activity/by_friends", - "statuses/media_timeline", - "timeline/home", - "help/experiments", - "search/typeahead", - "search/universal", - "discover/universal", - "conversation/show", - "statuses/:id/activity/summary", - "account/login_verification_enrollment", - "account/login_verification_request", - "prompts/suggest", - - "beta/timelines/custom/list", - "beta/timelines/timeline", - "beta/timelines/custom/show" - ]; - httpmethods.POST = [ - // Tweets - "statuses/destroy/:id", - "statuses/update", - "statuses/retweet/:id", - "statuses/update_with_media", - "media/upload", - - // Direct Messages - "direct_messages/destroy", - "direct_messages/new", - - // Friends & Followers - "friendships/create", - "friendships/destroy", - "friendships/update", - - // Users - "account/settings__post", - "account/update_delivery_device", - "account/update_profile", - "account/update_profile_background_image", - "account/update_profile_colors", - "account/update_profile_image", - "blocks/create", - "blocks/destroy", - "account/update_profile_banner", - "account/remove_profile_banner", - "mutes/users/create", - "mutes/users/destroy", - - // Favorites - "favorites/destroy", - "favorites/create", - - // Lists - "lists/members/destroy", - "lists/subscribers/create", - "lists/subscribers/destroy", - "lists/members/create_all", - "lists/members/create", - "lists/destroy", - "lists/update", - "lists/create", - "lists/members/destroy_all", - - // Saved Searches - "saved_searches/create", - "saved_searches/destroy/:id", - - // Spam Reporting - "users/report_spam", - - // OAuth - "oauth/access_token", - "oauth/request_token", - "oauth2/token", - "oauth2/invalidate_token", - - // Internal - "direct_messages/read", - "account/login_verification_enrollment__post", - "push_destinations/enable_login_verification", - "account/login_verification_request__post", - - "beta/timelines/custom/create", - "beta/timelines/custom/update", - "beta/timelines/custom/destroy", - "beta/timelines/custom/add", - "beta/timelines/custom/remove" - ]; - for (var httpmethod in httpmethods) { - if (httpmethods[httpmethod].indexOf(method) > -1) { + var apimethods = getApiMethods(); + for (var httpmethod in apimethods) { + if (apimethods[httpmethod].indexOf(method) > -1) { return httpmethod; } } @@ -1508,6 +1520,7 @@ var Codebird = function () { setBearerToken: setBearerToken, setUseProxy: setUseProxy, setProxy: setProxy, + getApiMethods: getApiMethods, __call: __call, oauth_authenticate: oauth_authenticate, oauth_authorize: oauth_authorize, From 938f7cf1a68cabc94207e9304c6c632e9bc53633 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 24 Jun 2014 18:54:15 +0200 Subject: [PATCH 03/14] Add changelog entry for getApiMethods() --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index e469261..a29fdb7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ codebird-js - changelog ======================= 2.6.0 (not yet released) ++ Allow to get the supported API methods as array 2.5.0 (2014-06-23) + #24 Add README section about xAuth From c089d90c7aa7ea4440e219a3c16b9b53c29ee28b Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 27 Sep 2014 10:37:03 +0200 Subject: [PATCH 04/14] Use POST for `users/lookup`, fix #79 Parameter list may get too large for GET when sending 100 user IDs or screen names --- codebird.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebird.js b/codebird.js index ed7dc09..77552cf 100644 --- a/codebird.js +++ b/codebird.js @@ -354,7 +354,6 @@ var Codebird = function () { "account/verify_credentials", "blocks/list", "blocks/ids", - "users/lookup", "users/show", "users/search", "users/contributees", @@ -459,6 +458,7 @@ var Codebird = function () { "account/update_profile_image", "blocks/create", "blocks/destroy", + "users/lookup", "account/update_profile_banner", "account/remove_profile_banner", "mutes/users/create", From 508609ee398bb2f569b5d681835381f2cba85077 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 27 Sep 2014 10:37:56 +0200 Subject: [PATCH 05/14] Add changelog entry for #79 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index a29fdb7..f4784ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ codebird-js - changelog 2.6.0 (not yet released) + Allow to get the supported API methods as array +- #79 Use POST for users/lookup API method, params may get too long for GET 2.5.0 (2014-06-23) + #24 Add README section about xAuth From 61d62b4284269f059f3f7332b4a86248fd9ac0f4 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 27 Sep 2014 10:52:15 +0200 Subject: [PATCH 06/14] Use POST for `statuses/lookup` as well, as per #79 Parameter list may get too large for GET when sending 100 tweet IDs --- codebird.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/codebird.js b/codebird.js index 77552cf..373cfe5 100644 --- a/codebird.js +++ b/codebird.js @@ -408,9 +408,6 @@ var Codebird = function () { "help/tos", "application/rate_limit_status", - // Tweets - "statuses/lookup", - // Internal "users/recommendations", "account/push_destinations/device", @@ -439,6 +436,7 @@ var Codebird = function () { "statuses/retweet/:id", "statuses/update_with_media", "media/upload", + "statuses/lookup", // Direct Messages "direct_messages/destroy", From 85c46fe3602388378a3b4de8d7da3f3b104e26d4 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 27 Sep 2014 10:52:30 +0200 Subject: [PATCH 07/14] Amend changelog entry for #79 --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index f4784ed..6295aec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,7 @@ codebird-js - changelog 2.6.0 (not yet released) + Allow to get the supported API methods as array -- #79 Use POST for users/lookup API method, params may get too long for GET +- #79 Use POST for users/lookup and statuses/lookup, params may get too long for GET 2.5.0 (2014-06-23) + #24 Add README section about xAuth From a69e5542486d219687ca4e4da97aa828b730d69e Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 27 Sep 2014 10:53:50 +0200 Subject: [PATCH 08/14] Sort API methods alphabetically For easier maintenance --- codebird.js | 190 ++++++++++++++++++++-------------------------------- 1 file changed, 73 insertions(+), 117 deletions(-) diff --git a/codebird.js b/codebird.js index 373cfe5..df17a82 100644 --- a/codebird.js +++ b/codebird.js @@ -317,96 +317,69 @@ var Codebird = function () { var getApiMethods = function () { var httpmethods = { GET: [ - // Timelines - "statuses/mentions_timeline", - "statuses/user_timeline", - "statuses/home_timeline", - "statuses/retweets_of_me", - - // Tweets - "statuses/retweets/:id", - "statuses/show/:id", - "statuses/oembed", - "statuses/retweeters/ids", - - // Search - "search/tweets", - - // Direct Messages + "account/settings", + "account/verify_credentials", + "application/rate_limit_status", + "blocks/ids", + "blocks/list", "direct_messages", "direct_messages/sent", "direct_messages/show", - - // Friends & Followers - "friendships/no_retweets/ids", - "friends/ids", + "favorites/list", "followers/ids", - "friendships/lookup", + "followers/list", + "friends/ids", + "friends/list", "friendships/incoming", + "friendships/lookup", + "friendships/lookup", + "friendships/no_retweets/ids", "friendships/outgoing", "friendships/show", - "friends/list", - "followers/list", - "friendships/lookup", - - // Users - "account/settings", - "account/verify_credentials", - "blocks/list", - "blocks/ids", - "users/show", - "users/search", - "users/contributees", - "users/contributors", - "users/profile_banner", - "mutes/users/ids", - "mutes/users/list", - - // Suggested Users - "users/suggestions/:slug", - "users/suggestions", - "users/suggestions/:slug/members", - - // Favorites - "favorites/list", - - // Lists + "geo/id/:place_id", + "geo/reverse_geocode", + "geo/search", + "geo/similar_places", + "help/configuration", + "help/languages", + "help/privacy", + "help/tos", "lists/list", - "lists/statuses", + "lists/members", + "lists/members/show", "lists/memberships", + "lists/ownerships", + "lists/show", + "lists/statuses", "lists/subscribers", "lists/subscribers/show", - "lists/members/show", - "lists/members", - "lists/show", "lists/subscriptions", - "lists/ownerships", - - // Saved searches + "mutes/users/ids", + "mutes/users/list", + "oauth/authenticate", + "oauth/authorize", "saved_searches/list", "saved_searches/show/:id", - - // Places & Geo - "geo/id/:place_id", - "geo/reverse_geocode", - "geo/search", - "geo/similar_places", - - // Trends - "trends/place", + "search/tweets", + "statuses/home_timeline", + "statuses/mentions_timeline", + "statuses/oembed", + "statuses/retweeters/ids", + "statuses/retweets/:id", + "statuses/retweets_of_me", + "statuses/show/:id", + "statuses/user_timeline", "trends/available", "trends/closest", - - // OAuth - "oauth/authenticate", - "oauth/authorize", - - // Help - "help/configuration", - "help/languages", - "help/privacy", - "help/tos", - "application/rate_limit_status", + "trends/place", + "users/contributees", + "users/contributors", + "users/profile_banner", + "users/search", + "users/show", + "users/suggestions", + "users/suggestions/:slug", + "users/suggestions/:slug/members", // Internal "users/recommendations", @@ -430,65 +403,48 @@ var Codebird = function () { "beta/timelines/custom/show" ], POST: [ - // Tweets - "statuses/destroy/:id", - "statuses/update", - "statuses/retweet/:id", - "statuses/update_with_media", - "media/upload", - "statuses/lookup", - - // Direct Messages - "direct_messages/destroy", - "direct_messages/new", - - // Friends & Followers - "friendships/create", - "friendships/destroy", - "friendships/update", - - // Users + "account/remove_profile_banner", "account/settings__post", "account/update_delivery_device", "account/update_profile", "account/update_profile_background_image", + "account/update_profile_banner", "account/update_profile_colors", "account/update_profile_image", "blocks/create", "blocks/destroy", - "users/lookup", - "account/update_profile_banner", - "account/remove_profile_banner", - "mutes/users/create", - "mutes/users/destroy", - - // Favorites - "favorites/destroy", + "direct_messages/destroy", + "direct_messages/new", "favorites/create", - - // Lists + "favorites/destroy", + "friendships/create", + "friendships/destroy", + "friendships/update", + "lists/create", + "lists/destroy", + "lists/members/create", + "lists/members/create_all", "lists/members/destroy", + "lists/members/destroy_all", "lists/subscribers/create", "lists/subscribers/destroy", - "lists/members/create_all", - "lists/members/create", - "lists/destroy", "lists/update", - "lists/create", - "lists/members/destroy_all", - - // Saved Searches - "saved_searches/create", - "saved_searches/destroy/:id", - - // Spam Reporting - "users/report_spam", - - // OAuth + "media/upload", + "mutes/users/create", + "mutes/users/destroy", "oauth/access_token", "oauth/request_token", - "oauth2/token", "oauth2/invalidate_token", + "oauth2/token", + "saved_searches/create", + "saved_searches/destroy/:id", + "statuses/destroy/:id", + "statuses/lookup", + "statuses/retweet/:id", + "statuses/update", + "statuses/update_with_media", + "users/lookup", + "users/report_spam", // Internal "direct_messages/read", From 02c8e940aa319f29c9954cf1b6e58f1973766e15 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Fri, 24 Oct 2014 16:36:54 +0200 Subject: [PATCH 09/14] Deprecate statuses/update_with_media, update README --- README.md | 28 +++++++--------------------- codebird.js | 2 +- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 72e16e4..53b8d65 100644 --- a/README.md +++ b/README.md @@ -272,26 +272,11 @@ cb.__call( ); ``` -### Uploading files to Twitter +### Uploading media to Twitter -The array syntax is obligatory, and the media have to be base64-encoded: +Tweet media can be uploaded in a 2-step process, and the media have to be +base64-encoded. **First** you send each image to Twitter, like this: -```javascript -var params = { - "status": "The bird is flying high. #larry", - "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" -); -cb.__call( - "statuses_updateWithMedia", - params, - function (reply) { - // ... - } -); -``` - -#### Multiple images -can be uploaded in a 2-step process. **First** you send each image to Twitter, like this: ```javascript var params = { "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( // you get a media id back: console.log(reply.media_id_string); - // continue upload of 2nd image here + // continue upload of 2nd image here, if any (just 1 image works, too!) } ); ``` + **Second,** you attach the collected media ids for all images to your call to ```statuses/update```, like this: @@ -323,7 +309,7 @@ cb.__call( ); ``` -More [documentation for tweeting with multiple media](https://dev.twitter.com/docs/api/multiple-media-extended-entities) is available on the Twitter Developer site. +More [documentation for tweeting with media](https://dev.twitter.com/rest/public/uploading-media-multiple-photos) is available on the Twitter Developer site. ### Requests with app-only auth @@ -385,7 +371,7 @@ The library returns the response HTTP status code, so you can detect rate limits I suggest you to check if the ```reply.httpstatus``` property is ```400``` and check with the Twitter API to find out if you are currently being rate-limited. -See the [Rate Limiting FAQ](https://dev.twitter.com/docs/rate-limiting-faq) +See the [Rate Limiting FAQ](https://dev.twitter.com/rest/public/rate-limiting) for more information. If you allow your callback function to accept a second parameter, diff --git a/codebird.js b/codebird.js index df17a82..b09656b 100644 --- a/codebird.js +++ b/codebird.js @@ -442,7 +442,7 @@ var Codebird = function () { "statuses/lookup", "statuses/retweet/:id", "statuses/update", - "statuses/update_with_media", + "statuses/update_with_media", // deprecated, use media/upload "users/lookup", "users/report_spam", From 6a788de48aab5ed8cbc3b97c79c92ab10f0e0830 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Fri, 24 Oct 2014 16:39:36 +0200 Subject: [PATCH 10/14] [FIX] Special oauth_ methods: force_login param Fix #81. We need a `&` sign to append to the existing `url`, which already contains a `?`. --- CHANGELOG | 1 + codebird.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6295aec..beeb262 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ codebird-js - changelog 2.6.0 (not yet released) + Allow to get the supported API methods as array - #79 Use POST for users/lookup and statuses/lookup, params may get too long for GET +- #81 Special oauth_ methods: Fix force_login parameter 2.5.0 (2014-06-23) + #24 Add README section about xAuth diff --git a/codebird.js b/codebird.js index b09656b..a5751c7 100644 --- a/codebird.js +++ b/codebird.js @@ -587,7 +587,7 @@ var Codebird = function () { } var url = _endpoint_oauth + "oauth/authenticate?oauth_token=" + _url(_oauth_token); if (params.force_login === true) { - url += "?force_login=1"; + url += "&force_login=1"; if (params.screen_name !== null) { url += "&screen_name=" + params.screen_name; } @@ -613,7 +613,7 @@ var Codebird = function () { } var url = _endpoint_oauth + "oauth/authorize?oauth_token=" + _url(_oauth_token); if (params.force_login === true) { - url += "?force_login=1"; + url += "&force_login=1"; if (params.screen_name !== null) { url += "&screen_name=" + params.screen_name; } From 7695fef15ac41c6d0f48d44888f830226ed07af7 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 28 Mar 2015 20:11:00 +0100 Subject: [PATCH 11/14] [TASK] Set year to 2015 --- README.md | 2 +- bower.json | 2 +- codebird.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53b8d65..775a8d0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ codebird-js =========== *A Twitter library in JavaScript.* -Copyright (C) 2010-2014 Jublo Solutions +Copyright (C) 2010-2015 Jublo Solutions This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/bower.json b/bower.json index cb6aa2a..30597e5 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "codebird-js", - "version": "2.6.0-dev", + "version": "2.6.0-rc.1", "homepage": "http://www.jublo.net/projects/codebird/js", "authors": [ "Joshua Atkins ", diff --git a/codebird.js b/codebird.js index a5751c7..8cd15db 100644 --- a/codebird.js +++ b/codebird.js @@ -4,7 +4,7 @@ * @package codebird * @version 2.6.0-dev * @author Jublo Solutions - * @copyright 2010-2014 Jublo Solutions + * @copyright 2010-2015 Jublo Solutions * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 * @link https://github.com/jublonet/codebird-php */ From fb689b16fe36b62b70f8e75f49dcd663909d4423 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Sat, 28 Mar 2015 20:12:00 +0100 Subject: [PATCH 12/14] [TASK] Set version to 2.6.0-rc.1 --- codebird.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codebird.js b/codebird.js index 8cd15db..894cb53 100644 --- a/codebird.js +++ b/codebird.js @@ -2,7 +2,7 @@ * A Twitter library in JavaScript * * @package codebird - * @version 2.6.0-dev + * @version 2.6.0-rc.1 * @author Jublo Solutions * @copyright 2010-2015 Jublo Solutions * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 @@ -135,7 +135,7 @@ var Codebird = function () { /** * The current Codebird version */ - var _version = "2.6.0-dev"; + var _version = "2.6.0-rc.1"; /** * Sets the OAuth consumer key and secret (App key) diff --git a/package.json b/package.json index 8f9489f..25870b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codebird", - "version": "2.6.0-dev", + "version": "2.6.0-rc.1", "description": "A Twitter library in JavaScript.", "keywords": [ "Twitter", From db104896d4d0ba679f247b0af51ce7a765ef9b2e Mon Sep 17 00:00:00 2001 From: "J.M" Date: Wed, 8 Apr 2015 10:45:08 +0200 Subject: [PATCH 13/14] [TASK] Set version to 2.6.0 --- bower.json | 2 +- codebird.js | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 30597e5..c19e1aa 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "codebird-js", - "version": "2.6.0-rc.1", + "version": "2.6.0", "homepage": "http://www.jublo.net/projects/codebird/js", "authors": [ "Joshua Atkins ", diff --git a/codebird.js b/codebird.js index 894cb53..baeaddd 100644 --- a/codebird.js +++ b/codebird.js @@ -2,7 +2,7 @@ * A Twitter library in JavaScript * * @package codebird - * @version 2.6.0-rc.1 + * @version 2.6.0 * @author Jublo Solutions * @copyright 2010-2015 Jublo Solutions * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 @@ -135,7 +135,7 @@ var Codebird = function () { /** * The current Codebird version */ - var _version = "2.6.0-rc.1"; + var _version = "2.6.0"; /** * Sets the OAuth consumer key and secret (App key) diff --git a/package.json b/package.json index 25870b9..9a98048 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codebird", - "version": "2.6.0-rc.1", + "version": "2.6.0", "description": "A Twitter library in JavaScript.", "keywords": [ "Twitter", From af95ec8abc016120bdd516b5bb07f5eeaccb4833 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Wed, 8 Apr 2015 10:45:18 +0200 Subject: [PATCH 14/14] [TASK] Set release date for 2.6.0 --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index beeb262..51eb546 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ codebird-js - changelog ======================= -2.6.0 (not yet released) +2.6.0 (2015-04-08) + Allow to get the supported API methods as array - #79 Use POST for users/lookup and statuses/lookup, params may get too long for GET - #81 Special oauth_ methods: Fix force_login parameter