From e5ebeb8d9842aa061d28cc4e7d8968aab4a4d3b1 Mon Sep 17 00:00:00 2001 From: Ludovic Fleury Date: Sun, 26 Apr 2015 13:04:32 +0200 Subject: [PATCH 1/2] Add /users/lookup.json support --- lib/Twitter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Twitter.js b/lib/Twitter.js index 93c891f..45b8b00 100644 --- a/lib/Twitter.js +++ b/lib/Twitter.js @@ -122,6 +122,12 @@ Twitter.prototype.getUser = function (params, error, success) { this.doRequest(url, error, success); }; +Twitter.prototype.getUsers = function (params, error, success) { + var path = '/users/lookup.json'; + var url = this.baseUrl + path; + this.doPost(url, params, error, success); +}; + Twitter.prototype.getFollowersList = function (params, error, success) { var path = '/followers/list.json' + this.buildQS(params); var url = this.baseUrl + path; @@ -173,7 +179,7 @@ Twitter.prototype.doPost = function (url, post_body, error, success) { .replace(/\(/g, "%28") .replace(/\)/g, "%29") .replace(/\*/g, "%2A"); - //(url, oauth_token, oauth_token_secret, post_body, post_content_type, callback + //(url, oauth_token, oauth_token_secret, post_body, post_content_type, callback this.oauth.post(url, this.accessToken, this.accessTokenSecret, post_body, "application/x-www-form-urlencoded", function (err, body, response) { console.log('URL [%s]', url); if (!err && response.statusCode == 200) { From 691e65c5b40dc48cbbee377ec56649e532f5247c Mon Sep 17 00:00:00 2001 From: Ludovic Fleury Date: Sun, 26 Apr 2015 13:06:13 +0200 Subject: [PATCH 2/2] Add /friends/ids.json support --- lib/Twitter.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Twitter.js b/lib/Twitter.js index 45b8b00..b1f23f8 100644 --- a/lib/Twitter.js +++ b/lib/Twitter.js @@ -128,6 +128,12 @@ Twitter.prototype.getUsers = function (params, error, success) { this.doPost(url, params, error, success); }; +Twitter.prototype.getFriendsIds = function (params, error, success) { + var path = '/friends/ids.json' + this.buildQS(params); + var url = this.baseUrl + path; + this.doRequest(url, error, success); +}; + Twitter.prototype.getFollowersList = function (params, error, success) { var path = '/followers/list.json' + this.buildQS(params); var url = this.baseUrl + path;