meddelare-counters
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -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/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19625
186