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

meddelare-counters

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meddelare-counters - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

12

lib/index.js

@@ -64,8 +64,3 @@ "use strict";

facebook: function(url, callback) {
// This query string gets the total number of likes, shares and comments to
// create the final count
var apiUrl = "https://graph.facebook.com/fql?q=SELECT%20url," +
"%20normalized_url,%20share_count,%20like_count,%20comment_count," +
"%20total_count,commentsbox_count,%20comments_fbid," +
"%20click_count%20FROM%20link_stat%20WHERE%20url='" + encodeURIComponent(url) + "'";
var apiUrl = "https://graph.facebook.com/" + encodeURIComponent(url);

@@ -80,7 +75,8 @@ request.get({

if (!body || !Array.isArray(body.data) || body.data.length === 0 || typeof body.data[0].total_count !== "number") {
if (!body || !body.share || typeof body.share.comment_count !== "number" || typeof body.share.share_count !== "number") {
return callback(new Error("No well-formed body in response."));
}
var count = body.data[0].total_count;
// The "total count" will be the "comment count" plus the "share count."
var count = body.share.comment_count + body.share.share_count;

@@ -87,0 +83,0 @@ callback(null, count);

{
"name": "meddelare-counters",
"version": "1.0.5",
"version": "1.0.6",
"description": "Node.js promise-based, asynchronous, parallel, per-URL social network share count fetcher -- the base of Meddelare.",

@@ -5,0 +5,0 @@ "homepage": "https://meddelare.com/",

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