linkedin-js
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -45,2 +45,16 @@ var url = require('url') | ||
function requestCallback(callback) { | ||
return function (error, data, response) { | ||
if (error) { | ||
callback(error, null); | ||
} else { | ||
try { | ||
callback(null, JSON.parse(data)); | ||
} catch (exc) { | ||
callback(exc, null); | ||
} | ||
} | ||
}; | ||
} | ||
if (method.toUpperCase() === 'GET') { | ||
@@ -53,3 +67,3 @@ params.format = 'json'; | ||
, token.oauth_token_secret | ||
, callback | ||
, requestCallback(callback) | ||
); | ||
@@ -63,3 +77,3 @@ } else if (method.toUpperCase() === 'POST') { | ||
, 'application/json; charset=UTF-8' | ||
, callback | ||
, requestCallback(callback) | ||
); | ||
@@ -66,0 +80,0 @@ } |
{ | ||
"name": "linkedin-js", | ||
"description": "Minimalistic linkedin API client", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"author": "Pau Ramon <masylum@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": ["linkedin"], |
7852
166