Socket
Socket
Sign inDemoInstall

facebook-chat-api

Package Overview
Dependencies
75
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.7 to 0.2.8

2

index.js

@@ -24,3 +24,2 @@ /*jslint node: true */

var $ = cheerio.load(html);
require("fs").writeFileSync("login.html", html);
var arr = [];

@@ -63,3 +62,2 @@

var html = res.body;
require("fs").writeFileSync("index.html", html);
var headers = res.headers;

@@ -66,0 +64,0 @@

2

package.json
{
"name": "facebook-chat-api",
"version": "0.2.7",
"version": "0.2.8",
"description": "Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated April 30th 2015.",

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

@@ -96,5 +96,8 @@ # Facebook Chat API

* `coordinates` - An object containing `latitude`, `longitude`, and `accuracy`.
* `type` - The string `"message"` or `"sticker"`
* `type` - The string `"message"`, `"sticker"`, `"file"`, `"photo"`, `"animated_image"`, or `"event"` (if applicable, see below).
If `type` is `"sticker"` there will be a `sticker_id` and `sticker_url` field instead of `body`.
If `type` is `file` there will be a `name` and a `file_url` instead of `body`.
If `type` is `photo` there will be `name`,`hires_url`, `thumbnail_url`, and `preview_url` instead of `body`.
If `type` is `animated_image` there will be `name`, `url`, and `preview_url` instead of `body`.

@@ -101,0 +104,0 @@ If enabled this will also handle events. In this case, `message` will be either a message (see above) or an event object with the following fields

@@ -109,2 +109,26 @@ /*jslint node: true */

}
if (originalMessage.attachments[i].attach_type === "file"){
obj.type = "file";
delete obj.body;
obj.name = originalMessage.attachments[i].name;
obj.file_url = originalMessage.attachments[i].url;
break;
}
if (originalMessage.attachments[i].attach_type === "photo"){
obj.type = "photo";
delete obj.body;
obj.name = originalMessage.attachments[i].name;
obj.hires_url = originalMessage.attachments[i].hires_url;
obj.thumbnail_url = originalMessage.attachments[i].thumbnail_url;
obj.preview_url = originalMessage.attachments[i].preview_url
break;
}
if (originalMessage.attachments[i].attach_type === "animated_image"){
obj.type = "animated_image";
delete obj.body;
obj.name = originalMessage.attachments[i].name;
obj.url = originalMessage.attachments[i].url;
obj.preview_url = originalMessage.attachments[i].preview_url;
break;
}
}

@@ -111,0 +135,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc