logo
down
shadow

Facebook Like button showing total count of Likes, Shares and Comments - not just Liked count


Facebook Like button showing total count of Likes, Shares and Comments - not just Liked count

By : dosi
Date : November 19 2020, 12:41 AM
Does that help Facebook appears to count "shares" and "likes" together as one number now, since 2011. This is why the Like button shows a number that includes Shares in addition to Likes and Comments.
code :


Share : facebook icon twitter icon
Facebook Like Button Count for URLS that Already Have Likes/Shares/Comments

Facebook Like Button Count for URLS that Already Have Likes/Shares/Comments


By : user3843535
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , 1) I don't think they will ever show up if they haven't so far.. (see answer 3)
2) No. An URL with or without http:// will be treated as the same URL. But I recommend using http://
How can I count the total number of all likes and comments on every object on a facebook page?

How can I count the total number of all likes and comments on every object on a facebook page?


By : El Niño Puyat Bautis
Date : March 29 2020, 07:55 AM
This might help you Matthew's solution is pretty fine, but lacks pagination, which is pretty important. I assume you use PHP, so I'll show you solution I used once before
Assuming you're using PHP SDK
code :
include("fb.class.php");

ignore_user_abort(true);
set_time_limit(0);

$fb = new Facebook(array(
    "appId" => "2859321",
    "secret" => "b226a5sd46as5d4as6d513as",
));

if (!$fb->getUser()) {
    if (file_get_contents("accessToken")) {
        $fb->setAccessToken(file_get_contents("accessToken"));
    } else {
        die("We have no access token for adult only pages");
    }
}

$page_ids = array();
$page_ids[] = 40796308305; // cocacola

function processPage($data, $id, &$pageComments, &$pageLikes, $&lastTime, $fb) {
    foreach($data as $index => $post) {
        $post = (object)$post;
        $pageComments += $post->comments['count'];
        $pageLikes += $post->likes['count'];
        $lastTime = $post->created_time;
    }

    $result = ($fb->api("/fql?q=".urlencode("SELECT comments.count, created_time, likes.count FROM stream WHERE source_id = {$id} AND created_time < {$lastTime} LIMIT 10000")));
    echo "Proccessing ".count($data)." posts. Last post has time $lastTime\n";
    if ($result) {
        processPage($result["data"], $id, $pageComments, $pageLikes, $lastTime, $fb);
    }
}

try {
    $totalComments = 0;
    $totalLikes = 0;

    foreach($page_ids as $id) {
        $pageComments = 0;
        $pageLikes = 0;

        $result = ($fb->api("/fql?q=".urlencode("SELECT comments.count, likes.count FROM stream WHERE source_id = ".$id." LIMIT 10000")));
        if (!empty($result["data"])) {
            //paginate
            processPage($result["data"], $id, $pageComments, $pageLikes, $lastTime, $fb);
            echo "Proccessed page id $id\n";
        }


        updateDbPost($id, $pageLikes, $pageComments);
    }


} catch (Exception $e) {
    die("Something failed, it should not have passed here :: ".$e->getMessage());
}


function updateDbPost($id, $pageLikes, $pageComments) {
    if ($pageLikes > 0) {
        //insert to the database
    }
}
Get total comments, likes, and shares from Facebook - prints only zeros

Get total comments, likes, and shares from Facebook - prints only zeros


By : Alexandre Menezes
Date : March 29 2020, 07:55 AM
Hope this helps They don't start doing metrics on Facebook pages until you have 30 number of fans and over. I'm pretty sure that's why, but not positive. I also can't see my facebook page counts. For more info & documentation (for what it's worth): http://developers.facebook.com/docs/insights/
Can I get the total count of a post likes, shares and comments using facebook sdk in Python?

Can I get the total count of a post likes, shares and comments using facebook sdk in Python?


By : Mansukh Vaghela
Date : March 29 2020, 07:55 AM
I wish this help you I want to get the total number of counts of a facebook post in python. The code below is giving a json object of some persons who likes the post. But not all. I need total counts. Is it possible? , Use this API call:
code :
/10153608167431961?fields=likes.limit(0).summary(true)
{
  "likes": {
    "data": [
    ],
    "summary": {
      "total_count": 13260,
      "can_like": true,
      "has_liked": false
    }
  },
  "id": "10153608167431961"
}
/10153608167431961/likes?summary=true&limit=0
{
  "data": [
  ],
  "summary": {
    "total_count": 13260,
    "can_like": true,
    "has_liked": false
  }
}
/10153608167431961/comments?summary=true&limit=0
how to get total comments/likes count? (Facebook)

how to get total comments/likes count? (Facebook)


By : Thomas Thyberg
Date : March 29 2020, 07:55 AM
With these it helps Eg. I wanna get an album's information by graph api (me/albums ) , Try to use something like this as the URL to fetch what you need:
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org