node-twitter-api
Advanced tools
Comparing version 1.6.5 to 1.7.0
{ | ||
"name": "node-twitter-api", | ||
"version": "1.6.5", | ||
"version": "1.7.0", | ||
"description": "Simple module for using Twitter's API in node.js", | ||
@@ -5,0 +5,0 @@ "keywords": ["twitter", "oauth", "rest", "streaming"], |
@@ -54,3 +54,3 @@ # node-twitter # | ||
```javascript | ||
twitter.verifyCredentials(accessToken, accessTokenSecret, function(error, data, response) { | ||
twitter.verifyCredentials(accessToken, accessTokenSecret, params, function(error, data, response) { | ||
if (error) { | ||
@@ -67,2 +67,3 @@ //something was wrong with either accessToken or accessTokenSecret | ||
``` | ||
In the above example, `params` is an optional object containing extra parameters to be sent to the Twitter endpoint (see https://dev.twitter.com/rest/reference/get/account/verify_credentials) | ||
@@ -69,0 +70,0 @@ ## Methods ## |
34
test.js
@@ -10,4 +10,4 @@ var twitterAPI = require("./index.js"); | ||
}); | ||
/* | ||
twitter.getRequestToken(function(error, requestToken, requestTokenSecret, results){ | ||
@@ -25,8 +25,8 @@ if (error) { | ||
var requestToken = "Fy-IMgAAAAAAE9XOAAABUcX9rF4"; | ||
var requestTokenSecret = "UlC1qAQR1WuuvYGKccbnvN4lEP3XT2jo"; | ||
var requestToken = "_LdZ_AAAAAAAE9XOAAABUidBHZk"; | ||
var requestTokenSecret = "JLqVufAXe12M9UrFqHgmhwhCpvqH2HkG"; | ||
/* | ||
twitter.getAccessToken(requestToken, requestTokenSecret, 5935085, function(error, accessToken, accessTokenSecret, results) { | ||
twitter.getAccessToken(requestToken, requestTokenSecret, 7132519, function(error, accessToken, accessTokenSecret, results) { | ||
if (error) { | ||
@@ -48,2 +48,3 @@ console.log(error); | ||
console.log(data["screen_name"]); | ||
console.log(data["email"]); | ||
console.log(response); | ||
@@ -53,9 +54,24 @@ } | ||
} | ||
}); | ||
});*/ | ||
*/ | ||
var accessToken = "56701719-bknqBPcWZO6ILBFyUhDPYqbm4K8wEH0skosGowefH"; | ||
var accessTokenSecret = "NrPiEEmk9Wepi6Xvqpgb1PD9qiqU9GmpuDsKY4V7N101C"; | ||
twitter.verifyCredentials(accessToken, accessTokenSecret, {"skip_status": true}, function(error, data, response) { | ||
if (error) { | ||
//something was wrong with either accessToken or accessTokenSecret | ||
//start over with Step 1 | ||
} else { | ||
//accessToken and accessTokenSecret can now be used to make api-calls (not yet implemented) | ||
//data contains the user-data described in the official Twitter-API-docs | ||
//you could e.g. display his screen_name | ||
console.log(data["screen_name"]); | ||
console.log(data["status"]); | ||
console.log(response); | ||
} | ||
}); | ||
/* | ||
@@ -75,3 +91,3 @@ twitter.uploadMedia({ | ||
/* | ||
twitter.statuses("oembed", {id: "507185938620219395"}, accessToken, accessTokenSecret, function(err, data, res) { | ||
@@ -81,3 +97,3 @@ console.log(err); | ||
//console.log(res); | ||
}); | ||
});*/ | ||
@@ -84,0 +100,0 @@ function base64_encode(file) { |
"use strict"; | ||
var VERSION = "1.6.5", | ||
var VERSION = "1.7.0", | ||
querystring = require("querystring"), | ||
@@ -53,5 +53,7 @@ oauth = require("oauth"), | ||
Twitter.prototype.verifyCredentials = function(accessToken, accessTokenSecret, callback, params) { | ||
Twitter.prototype.verifyCredentials = function(accessToken, accessTokenSecret, params, callback) { | ||
var url = baseUrl + "account/verify_credentials.json"; | ||
if(params) { | ||
if (typeof params == "function") { | ||
callback = params; | ||
} else { | ||
url += '?' + querystring.stringify(params); | ||
@@ -58,0 +60,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37124
992
111