facebook-chat-api
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -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 @@ |
{ | ||
"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 |
24
utils.js
@@ -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 @@ } |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
71326
1248
471
1
21