socializr
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -19,3 +19,10 @@ var stream = require('stream') | ||
function Page(id, accessToken){ | ||
this.id = id; | ||
this.accessToken = accessToken; | ||
}; | ||
function PubSubConnection(secret){ | ||
@@ -113,3 +120,28 @@ this.appSecret = secret; | ||
Facebook.prototype.getPages = function(user, token, cb){ | ||
this._graphRequest( user + '/accounts', 'GET', { | ||
access_token: token | ||
}, function(res){ | ||
cb&&cb(res); | ||
}); | ||
}; | ||
Facebook.prototype.install = function(pageId, token, cb){ | ||
this._graphRequest( pageId + '/tabs', 'POST', { | ||
app_id: this.appId, | ||
access_token: token | ||
}, function(res){ | ||
cb&&cb(res); | ||
}); | ||
}; | ||
Facebook.prototype.uninstall = function(pageId, token){ | ||
this._graphRequest( pageId + '/tabs/app_' + this.appId, 'DELETE', { | ||
access_token: token | ||
}, function(){ | ||
}); | ||
}; | ||
Facebook.prototype.pipeSubscription = function(){ | ||
@@ -130,12 +162,8 @@ var _this = this; | ||
var _this = this; | ||
return function(req, res, next){ | ||
console.log(req.query); | ||
return function(req, res){ | ||
if( _this.isVerifyToken( req.query['hub.verify_token'])){ | ||
res.send(req.query['hub.challenge']); | ||
res.send( req.query['hub.challenge']); | ||
}else { | ||
res.send('false'); | ||
res.send(401); | ||
} | ||
next(); | ||
}; | ||
@@ -142,0 +170,0 @@ }; |
{ | ||
"name": "socializr", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Read data streams from several social networks.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
27056
1107