top of page
Search
luxvigorito194usoe

Facebook Api Like Count Url



Removing 'count' from 'comments' Graph API connection We are removing the undocumented 'count' field on the 'comments' connection in the Graph API. Please request id/comments?summary=true explicitly if you would like the summary field which contains the count (now called 'total_count')


The second page clearly has a share count on it, and when I inspect the HTML of the page, the URL which is being used to share is the one I've placed into the API request above. However, the API does not respond with any count information for either number of likes or shares.




Facebook Api Like Count Url




I don't think Facebook's Open Graph Object i.e. "og_object" provides anything more than comment_count & share_count for a URL.Try this; replace $YOUR_URL with the URL and $ACCESS_TOKEN with your access token in the below link $YOUR_URL?access_token=$ACCESS_TOKEN


This returns detail JSON with paging info - but it omits the total_count which is supposed to be returned when "summary=true" is used as described in the Facebook docs - you'll see what I mean.


I spent almost two days to find a solution to get the Facebook Fan Page likes counter in numeric value to a shortcode. So I have amended a code I got from this link: -number-facebook-page-likes-wordpress-php/


/*Display the Number of Facebook Page Likes in Plain Text with WordPress Shortcode (and PHP)Shortcode: [fbpagelikes id="" appid="" appsecret="" cache="" n="1"]*/function internoetics_fb_pagelikes($atts) extract(shortcode_atts(array( 'id' => 'kenryscom', 'appid' => 'xxxxxxxxxxxxxxxx', 'appsecret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'n' => 1, 'cache' => 3600 * 24 * 1 ), $atts)); $fbcounthash = md5("$url.$cache.$appid.$appsecret.$n"); $fbcountrecord = 'fblikes_' . $fbcounthash; $cachedposts = get_transient($fbcountrecord); if ($cachedposts !== false) return $cachedposts; else $json_url =' ' . $id . '?fields=fan_count&access_token=' . $appid . 'add_shortcode('fbpagelikes','internoetics_fb_pagelikes');


If you're not a geek - here's the bottom line of this post: The Facebook "like" buttons you see embedded on websites incorrectly report the number of "people" who "like" something. Specifically, the button can inflate the displayed count of people. While this is fine when all you want to do is track some general level of "engagement" with a particular item, it was not accurate for the use I needed - counting each "like" as a vote in our BoldBrush Online painting competition. What I needed is a way to get the number of actual people who "like" something. And there is a way to retreive that information from Facebook, but it is often a different number from what is shown on the "like" button itself. If you are a geek - here's the bottom line of this post: If you're using the Facebook "Like" Button Social Plugin and you need an accurate count of the actual number of people who have clicked the "like" button, you can't rely on the number reported by the button itself. You need to retrieve your URL's "fan count" number via Facebook's Open Graph API[1] Background When I started our online painting contest, I had always planned to roll out a feature that allowed users to vote for their favorite paintings - eventually maybe creating some sort of people's choice award category. When Facebook released the "Like" button social plugin, I thought it would be simpler to just use their code. Plus, I thought, it would solve some problems. I had always worried about implementing the feature myself because if awards were tied to the voting, there would be incentive to "game the system" and I just didn't want to deal with a bunch of fake user accounts and identity verification issues that would arise because of the gaming. So I thought since most people use their real identities on Facebook, using the Facebook like button would largely solve the issue for me. I recently added that feature to our online painting competition. It lets Facebook users to "like" their favorite paintings. After a few weeks, I thought it would be fun to use those "like" counts to rank the paintings in order of popularity, with the "most popular" being the ones with the most "likes." So I dug into Facebook's api and found a way to retrieve the "like" data and hacked together a working solution. So far so good. The users were having a good time, it was interesting to watch the rankings change over time. I also decided not to tie any awards to these rankings (at least for now) since I didn't know how accurate the "like" data actually was - I'm glad I didn't. Like Button Inconsistencies If you properly register your application with Facebook, the like button gives the application owner access to an administrative page for each item on his website that has been "liked." I quickly started to notice something odd. One of the early top-ranking paintings displayed 331 "likes" on the button itself. This number matched what I was pulling from the api and was storing in my own database for ranking purposes. But when I clicked through to the adminitrative page for that item, it clearly displayed "140 People like this." There's a pretty big difference between 140 and 331 - way too big a difference if awards get involved.[2] At this point, I wasn't too worried since it was just for fun upon the initial launch, but with future uses in mind, I decided to dive-in and create a more controlled situation and see if I could figure out what was going on. Duplicating the Problem I visited a painting page that had no "likes" so far. I also picked a time when contest activity was low (it tends to be frantic toward deadlines and slow right after one contest ends and the next one starts). I also created a fake Facebook account (shhh don't tell Zuck) so that I could use my real account and the fake account to have data from two different Facebook users. While logged into Facebook with the fake "B Rockhurst" account, I visited the web page and clicked "Like." The next thing that happed was that the like button opened up a text box to allow me to type a message and "share" the item on my Facebook wall. So I typed "cool" and hit submit. Here's what the like button displays at this point: "B Rockhurst and one other person like this" So what's going on? To find out, I called Facebook's handy api. For this particular call I used the old REST api call in the following format: =links.getStats&urls=URL_OF_MY_WEBPAGE Which returned the following XML: Notice the "like_count" actually returns 1. But and the "share_count" also returns 1. That is correct. "B Rockhurst" "liked" the page once and shared it once. It seems, however, that the Facebook "Like" Button Social Plugin displays the "total_count" - which is now 2. In fact, I was already aware of this issue and had been using the "total_count" for my painting rankings so that the numbers would match the reported Facebook like button counts. I figured, in essence, everybody was allowed two votes - a "like" and a "share." And had decided not to worry about it until I had more time to study it. Next I logged into Facebook under my real account. I visited "B Rockhurst's" profile and I clicked "like" under the shared item on his wall: Then I called the API again, but alas, no change. Apparently "liking" an item on another's wall doesn't inflate the count (somewhat ironically since this actually is an instance of another person "liking" the item). OK, so what if I tried commenting? So I commented on "B Rockhurst's" item by writing "pretty cool": Again - checked the API - no change in the counts. Hmmm. what if I shared the item directly from "Barrett's" wall? Let's check the API again:


Clint, thought the article was informative but not sure if it anwsers my question. I have one painting entered into the contest, but only one like beside the button. If I look at my FB account, I see 5 for that particular piece. Are those "likes" not linked to your "like" button?? Also I would like to say...I'm new to Fineartstudioonline, but I love your application. It's easy to work with and tech support is outstanding! Starting to get more interest and look forward to a long lasting relationship. Artists should really look into what you have to offer! - Matthew www.matthewreadfineart.com


Matthew - glad your enjoying it! In my testing, when someone clicks "like" from the contest page - that counts in the total, but THEN if someone clicks LIKE next to the link on the facebook newsfeed, I don't think it counts - that's probably the difference. Right now it's just for fun, but when we go further with it, we're going to only count likes clicked from the contest page itself, plus we will add our own voting system and probably add the two in some way. Not sure exactly, but if we ever tie it to awards, we'll be sure it's about as game-proof as possible. Thanks for your kind feedback.


Clint, I have clients who are not on Facebook and would like to have voted but said when they attempted to vote "like", the link to Facebook made them exit the page. When you come up with your own voting system, it would be great if ALL people could vote not just Facebook. After all, aren't we trying to get people to visit our websites? Having Facebook pop up was a turn-off to many of my voters.


Linda - implementing our own voting system is planned, but Facebook provided a shortcut that we decided to take. I agree, it will be nice not to require facebook, but, since it's not for any actual monetary awards at this time, we went ahead and implemented the facebook solution for fun. Part 2 - yes, the goal is to get people to visit our sites, that's why our implementation requires the like button to be clicked from the actual painting page rather than inside the facebook wall stream. We want to be sure the "liker" actually views the painting. 2ff7e9595c


1 view0 comments

Recent Posts

See All

baixar mudrunner

Baixar MudRunner: A Melhor Experiência Off-Road Se você está procurando um jogo de simulação off-road emocionante e realista, você...

Commentaires


bottom of page