Skip to content

Commit

Permalink
Tumblr Integration fixed.
Browse files Browse the repository at this point in the history
changed tumblr urls to https
  • Loading branch information
rafipass committed Dec 13, 2013
1 parent a90d9aa commit 0df0614
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/modules/tumblr.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
var oauthModule = require('./oauth')
, Parser = require('xml2js').Parser;

var twitter = module.exports =
var t = module.exports =
oauthModule.submodule('tumblr')
.apiHost('http://www.tumblr.com/api')
.oauthHost('http://www.tumblr.com')
.apiHost('https://api.tumblr.com/v2')
.oauthHost('https://www.tumblr.com')
.entryPath('/auth/tumblr')
.callbackPath('/auth/tumblr/callback')
.sendCallbackWithAuthorize(false)
.fetchOAuthUser( function (accessToken, accessTokenSecret, params) {
var promise = this.Promise();
this.oauth.get(this.apiHost() + '/authenticate', accessToken, accessTokenSecret, function (err, data) {
this.oauth.get(this.apiHost() + '/user/info', accessToken, accessTokenSecret, function (err, data) {
if (err) return promise.fail(err);
var parser = new Parser();
parser.on('end', function (result) {
var oauthUser = result.tumblelog['@'];
promise.fulfill(oauthUser);
});
parser.parseString(data);
var oauthUser = JSON.parse(data);
promise.fulfill(oauthUser);
});
return promise;
})
Expand Down

0 comments on commit 0df0614

Please sign in to comment.