Socket
Socket
Sign inDemoInstall

node-fb-graph

Package Overview
Dependencies
61
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "node-fb-graph",
"version": "0.0.6",
"version": "0.0.7",
"description": "Node.js module for interacting with the Facebook Graph API",

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

@@ -9,2 +9,14 @@ 'use strict';

async function getPosts(pageAccessToken, pageId) {
const options = {
url: `${fbURL}/${pageId}/posts?access_token=${pageAccessToken}`,
method: 'GET'
};
const data = await rp.get(options, function(err, res, body) {
if (err) return err;
else return body;
});
return { page: { posts: JSON.parse(data).data } };
}
async function getRatings(pageAccessToken, pageId) {

@@ -19,6 +31,10 @@ const options = {

});
return {page: {ratings: JSON.parse(data).data}};
return { page: { ratings: JSON.parse(data).data } };
};
module.exports = {
getPosts: async function(pageAccessToken, pageId) {
const data = await getPosts(pageAccessToken, pageId);
return data;
},
getRatings: async function(pageAccessToken, pageId) {

@@ -25,0 +41,0 @@ const data = await getRatings(pageAccessToken, pageId);

@@ -10,2 +10,6 @@ 'use strict';

describe('node-fb-graph', function() {
it('return all posts for a given business page', async function() {
const result = await npmms.getPosts(_PAGE_ACCESS_TOKEN, _PAGE_ID);
expect(result.page.posts.length).to.be.greaterThan(0);
});
it('return all ratings for a given business page', async function() {

@@ -12,0 +16,0 @@ const result = await npmms.getRatings(_PAGE_ACCESS_TOKEN, _PAGE_ID);

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