Skip to content

Instantly share code, notes, and snippets.

Created January 10, 2018 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e64e35817119665eb7b83c78aa336e10 to your computer and use it in GitHub Desktop.
Save anonymous/e64e35817119665eb7b83c78aa336e10 to your computer and use it in GitHub Desktop.
Facebook Like Count Zero
********************
Facebook Like Count Zero ->>->>->>
********************
http://shurll.com/c0v7u
(Copy & Paste link)
********************
I want to redirect them to Main page after using facebook login button0get Facebook comments of a webpage0Facebook comment moderation tool doesn't work0Website - Facebook login with get user details like name, email, phone, image url,etc, Facebook V2.9 Hot Network Questions python 3 printing without parentheses varying error message QGIS Shapefile warps when zooming out Adding page specific JavaScript via SXA Draw a Hasse diagram with circles with 3 sectors What's underused by Americans? Is this pirate in the background a young Edward Teague? Can working on a mobile app with bad reviews affect my career? Do I need to coat beef in flour mixture for slow cooked stew? What is the mistake in "There are many Danes who speak English"? Does AWS offer a way to route HTTPS traffic to two different EC2 instances based on directory path? Why was there a robot in Rocky IV? How to be sure my advisor's insurance recommendations are good for me? The length of coil winding on cylinder. 1.1k SHARES ShareaScreamingGoat TweetaScreamingGoat Get these cool share buttons . Stack Overflow Questions Jobs Developer Jobs Directory Salary Calculator Help Mobile Stack Overflow Business Talent Ads Enterprise Company About Press Work Here Legal Privacy Policy Contact Us Stack Exchange Network Technology Life / Arts Culture / Recreation Science Other Stack Overflow Server Fault Super User Web Applications Ask Ubuntu Webmasters Game Development TeX - LaTeX Software Engineering Unix & Linux Ask Different (Apple) WordPress Development Geographic Information Systems Electrical Engineering Android Enthusiasts Information Security Database Administrators Drupal Answers SharePoint User Experience Mathematica Salesforce ExpressionEngine Answers Stack Overflow em Portugus Blender Network Engineering Cryptography Code Review Magento Software Recommendations Signal Processing Emacs Raspberry Pi Stack Overflow Programming Puzzles & Code Golf Stack Overflow en espaol Ethereum Data Science Arduino Bitcoin more (26) Photography Science Fiction & Fantasy Graphic Design Movies & TV Music: Practice & Theory Worldbuilding Seasoned Advice (cooking) Home Improvement Personal Finance & Money Academia Law more (16) English Language & Usage Skeptics Mi Yodeya (Judaism) Travel Christianity English Language Learners Japanese Language Arqade (gaming) Bicycles Role-playing Games Anime & Manga Puzzling Motor Vehicle Maintenance & Repair more (32) MathOverflow Mathematics Cross Validated (stats) Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more (10) Meta Stack Exchange Stack Apps API Data Area 51 Blog Facebook Twitter LinkedIn site design / logo 2018 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required. If you're using Skybrud.Social, your example above could be updated to: Fields = new[] { "fullpicture,type,link,picture,name,from,message,description,permalinkurl,createdtime,shares", // add more fields if you need them "comments.limit(0).summary(true)", "likes.limit(0).summary(true)" } if (post != null) { int likes = post.Likes.JsonObject.GetObject("summary").GetInt32("totalcount"); int comments = post.Comments.JsonObject.GetObject("summary").GetInt32("totalcount"); JsonObject sharesObj = post.JsonObject.GetObject("shares"); int shares = sharesObj == null ? 0 : sharesObj.GetInt32("count"); string.Format("Likes: {0}, Comments: {1}, Shares: {1}", likes, comments, shares) } If you're using Skybrud.Social.Core and Skybrud.Social.Facebook, your code could look like this: using Skybrud.Social.Facebook using Skybrud.Social.Facebook.Objects.Posts using Skybrud.Social.Facebook.Options.Posts using Skybrud.Social.Facebook.Responses.Posts inherits WebViewPage { FacebookGetPostsResponse response = Model.Posts.GetPosts(new FacebookGetPostsOptions { Identifier = "skybrud", Fields = "comments.limit(0).summary(true),likes.limit(0).summary(true),shares", }); foreach (FacebookPost post in response.Body.Data) { post.Id Comments: post.Comments.Summary.TotalCount Likes: post.Likes.Summary.TotalCount Shares: (post.Shares == null ? 0 : post.Shares.Count) } } . joshua-stewart commented Jul 16, 2015 In 0.9.3 FacebookPost.Likes.Count and FacebookPost.Comments.Count are returning 0 The FacekbookLikes call and the FacebookComments calls are trying to parse the "count" property the same way you changed Shares to work in 0.9.3 using: Count = obj.GetInt32("count") but neither Likes or Shares have a "count" property in the JsonObject so they are both returning 0. AndersBrohus commented Feb 5, 2016 Hi abjerner :-) This bug i still there. .. My website's URL where it is live is here facebook facebook-graph-api facebook-like shareimprove this question asked Nov 5 '14 at 14:55 Yin Yang 66711032 possible duplicate of Facebook like count is suddenly zero –luschn Nov 5 '14 at 15:15 luschn Looks like it's an issue at Facebook's end –Yin Yang Nov 5 '14 at 15:46 i know, you guys keep opening new threads on stackoverflow for the exact same bug –luschn Nov 5 '14 at 15:46 add a comment 2 Answers 2 active oldest votes up vote 0 down vote accepted It was an issue at Facebook's end. Thanks for the heads up then ;) The count property used to part of the JSON received from Facebook, which is why there is a corresponding Count property in Skybrud.Social. Old Random Projects . Owner abjerner commented Feb 8, 2016 AndersBrohus Okay. Next Next Done . Blogroll Alchemist Books Alice Cirjan Cara Nahaul Epic Plugins Epic Themes Hayday Construction & Roofing Mizanur Rahman SmugPup Groomers StormGate WordPress CRM WordPress Marketing Plugins . Is there a way to safely have exposed electrical wires? Has a character ever been told the odds, but then didn't go on to beat them? Is standing actually illegal in Venice? Conditional probabilities - are they unique to Bayesianism? Why doesn't soda go flat immediately after opening? Typographical emphasis on text is ambiguous Lens hood visible when shooting in RAW, but not in JPEG Why don't ICs include bypass capacitors? How to keep democracies from falling behind technologically? Finding pairs of Amicable Numbers, up to 10000 How can I help my SO to overcome his fear particularly when I don't understand it? more hot questions question feed . Stack Overflow works best with JavaScript enabled .. joshua-stewart commented Jul 16, 2015 Thanks for the quick response - I appreciate it. Owner abjerner commented Feb 8, 2016 AndersBrohus Can you post an example of the part of your code that actually reads the total count? You may have to do it as in my example since Facebook changed the way they specify the total count. AndersBrohus commented Feb 8, 2016 abjerner I don't need the total count, i just returned the response that i got with the code from above :-) . v2.4 will have "Fewer default fields for faster performance". While not directly supported, you can still accomplish it by playing around with the underlying JSON: FacebookPostsResponse response = service.Posts.GetPosts(new FacebookGetPostsOptions { Identifier = "skybrud", Fields = new[] { // add more fields if you need them "comments.limit(0).summary(true)", "likes.limit(0).summary(true)" } }); foreach (FacebookPost post in response.Body.Data) { int likes = post.Likes.JsonObject.GetObject("summary").GetInt32("totalcount"); int comments = post.Comments.JsonObject.GetObject("summary").GetInt32("totalcount"); } The first thing you should notice in the example above, is that you have to explicitly tell the Graph API to return the total count for both likes and comments. Hoping to release v0.9.4.1 soon though ;) . Our Services Home FAQs Free Likes Privacy Policy . Sounds great. The Archived Blog Life: GamesIdeasLooking BackLooking ForwardMusicOpen LettersPhotographyWoodyLabsWriting Business: Affiliate MarketingBusiness IntelligenceProjectsPublishingSearch Engine OptimisationSocial MediaSoftware Code: ASP.NetBrowser CompatibilityC#CSSFacebook Graph APIJavascriptPHPSnippetsTransactional SQLWeb DevelopmentWordpress Technology: SQL ServerSSRSVisualisationWeb TechnologyWiki Media Travel . Do you already like us on Facebook? Do not ask me again for Facebook Continue to the article . abjerner added this to the v0.9.4.1 milestone Aug 11, 2015 . AndersBrohus commented Feb 5, 2016 I tried with this code :-) public FacebookPostsResponse getFBAccess() { string appId = "XXXXXXX"; string appSecret = "XXXXXXXXXXXXXXXXXXXXX"; FacebookOAuthClient client = new FacebookOAuthClient(appId, appSecret); string accessToken = client.GetAppAccessToken(); FacebookService service = FacebookService.CreateFromAccessToken(accessToken); FacebookPostsResponse response = service.Posts.GetPosts("XXXXXXXXXXXXXX"); return response; } The X's definded to the real strings and ids :P . The New Blog WoodyHayday.com . Copyright 2018 Boostlikes.com. AndersBrohus commented Feb 8, 2016 Hi again abjerner :-) The code i posted is the way i call the API, and in the response there is a "total count" of likes and comments that always says 0 :-) . FacebookPostsOptions can still be used, but is marked as obsolete. .. bjarnef commented Feb 1, 2017 abjerner okay, I tried some different approaches in Skybrud.Social and also added the shares field. Owner abjerner commented Jul 16, 2015 Thanks for reporting :D I can't remember this exactly, but then Facebook might have changed something. Then you can read the total count through the JSON as shown. Owner abjerner commented Feb 5, 2016 AndersBrohus Based on your code, I'm not exactly sure what you're trying to do? Are you trying to get the amount of likes/comments of each individual post? If so, this is not directly supported at the moment. I think for the next release, I will add support for specifying a Fields property (as a string for now): // Make the request to the API FacebookPostsResponse response = service.Posts.GetPosts("me", new FacebookPostsOptions { Fields = "comments.limit(0).summary(true),likes.limit(0).summary(true)", Limit = 20 }); And then for next release after that, perhaps add some utility methods for helping developers to generate the fields string (since it can be become quite complex as you have pointed out). .. It's back! Take the 2018 Developer Survey today 5a02188284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment