Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

socializr

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socializr - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

39

lib/providers/facebook.js

@@ -19,10 +19,34 @@ var stream = require('stream')

function Page(id, accessToken){
this.id = id;
function OAuthConnection(accessToken, ownerId){
this.accessToken = accessToken;
this.tokenOwner = ownerId;
};
function OAuthConnectionStore() {
_connections = {};
};
OAuthConnectionStore.prototype.add = function(accessToken, ownerId){
return new OAuthConnection( accessToken, ownerId);
};
OAuthConnectionStore.prototype.get = function(ownerId){
return this._connections.hasOwnProperty(ownerId) ?
this._connections[ ownerId] :
null;
};
OAuthConnectionStore.prototype.drop = function(ownerId){
if( this._connections.hasOwnProperty(ownerId) ){
delete this._connections[ ownerId];
return true;
}
return false;
};
function PubSubConnection(secret){

@@ -59,2 +83,4 @@ this.appSecret = secret;

this._pubsubConnections = {};
this._oauthConnections = new OAuthConnectionStore();
};

@@ -130,2 +156,3 @@ util.inherits(Facebook, Transform);

Facebook.prototype.install = function(pageId, token, cb){
this._oauthConnections.add( token, pageId);
this._graphRequest( pageId + '/tabs', 'POST', {

@@ -178,7 +205,10 @@ app_id: this.appId,

var expected = 0
, fb = this;
, fb = this
;
for( var i in chunk.entry){
//console.log(chunk.entry[i].changes);
console.log(chunk.entry[i].changes);
var auth = this._oauthConnections.get( chunk.entry[i].id);
for( var j in chunk.entry[i].changes){

@@ -191,2 +221,3 @@

this._graphRequest( chunk.entry[i].changes[j].value.post_id, 'GET', {
access_token: auth.accessToken
}, function(res){

@@ -193,0 +224,0 @@ expected--;

2

package.json
{
"name": "socializr",
"version": "0.0.17",
"version": "0.0.18",
"description": "Read data streams from several social networks.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc