Socket
Socket
Sign inDemoInstall

fca-unofficial

Package Overview
Dependencies
7
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.15 to 1.0.16

3

DOCS.md

@@ -1002,3 +1002,3 @@ # Documentation

<a name="listen"></a>
### api.listen(callback)
### api.listen(callback) (deprecated, use `api.listenMqtt` instead)

@@ -1647,2 +1647,3 @@ Will call `callback` when a new message is received on this account.

- `proxy`: (Default empty) Set this to proxy server address to use proxy. Note: Only HTTP Proxies which support CONNECT method is supported.
- `online`: (Default `true`) Set account's online state.

@@ -1649,0 +1650,0 @@ __Example__

@@ -6,2 +6,3 @@ "use strict";

var log = require("npmlog");
var deasync = require("deasync");

@@ -14,2 +15,5 @@ var defaultLogRecordSize = 100;

switch (key) {
case 'online':
globalOptions.online = Boolean(options.online);
break;
case 'logLevel':

@@ -377,3 +381,3 @@ log.level = options.logLevel;

.then(function(_res) {
log.info("login", 'Request to pull 1');
log.info("login", 'Request to base pull');
var form = {

@@ -393,7 +397,5 @@ channel : 'p_' + ctx.userID,

ctx.jar.setCookie("presence=" + presence + "; path=/; domain=.facebook.com; secure", "https://www.facebook.com");
ctx.jar.setCookie("presence=" + presence + "; path=/; domain=.messenger.com; secure", "https://www.messenger.com");
ctx.jar.setCookie("locale=en_US; path=/; domain=.facebook.com; secure", "https://www.facebook.com");
ctx.jar.setCookie("locale=en_US; path=/; domain=.messenger.com; secure", "https://www.messenger.com");
ctx.jar.setCookie("a11y=" + utils.generateAccessiblityCookie() + "; path=/; domain=.facebook.com; secure", "https://www.facebook.com");
return utils

@@ -409,3 +411,2 @@ .get("https://0-edge-chat.facebook.com/pull", ctx.jar, form, globalOptions)

}
return ret;

@@ -415,3 +416,3 @@ });

.then(function(resData) {
if (resData.t !== 'lb') throw {error: "Bad response from pull 1"};
if (resData.t !== 'lb') throw {error: "Bad response from base pull"};

@@ -432,7 +433,37 @@ var form = {

};
log.info("login", "Request to pull 2");
return utils
.get("https://0-edge-chat.facebook.com/pull", ctx.jar, form, globalOptions)
.then(utils.saveCookies(ctx.jar));
var lastOnlineTime = new Date();
setTimeout(function () {
var done = false;
for (;;) {
log.info("login", "Request to pull (ping)");
done = false;
utils.get("https://0-edge-chat.facebook.com/pull", ctx.jar, form, globalOptions)
.then(utils.saveCookies(ctx.jar))
.then(function () {
done = true;
});
deasync.loopWhile(function () {
return !done;
});
if (globalOptions.online) {
lastOnlineTime = new Date();
}
form = {
channel: 'p_' + ctx.userID,
seq: 0,
partition: -2,
clientid: ctx.clientID,
viewer_uid: ctx.userID,
uid: ctx.userID,
idle: Math.floor((new Date().getTime() - lastOnlineTime.getTime()) / 1000),
cap: 8,
msgs_recv: 0,
sticky_token: resData.lb_info.sticky,
sticky_pool: resData.lb_info.pool,
};
if (globalOptions.online) {
form.state = 'active';
}
}
}, 1);
});

@@ -483,2 +514,3 @@

logRecordSize: defaultLogRecordSize,
online: true,
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18"

@@ -485,0 +517,0 @@ };

{
"name": "fca-unofficial",
"version": "1.0.15",
"version": "1.0.16",
"description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.",

@@ -27,2 +27,3 @@ "scripts": {

"cheerio": "^0.22.0",
"deasync": "^0.1.19",
"https-proxy-agent": "^4.0.0",

@@ -38,3 +39,3 @@ "mqtt": "^3.0.0",

"eslint": "^4.19.1",
"mocha": "^2.2.5",
"mocha": "^7.0.1",
"prettier": "^1.11.1"

@@ -41,0 +42,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc