How to count all likes no matter how many times a post is shared and reshared? - facebook-like

I want to be able to count the total number of likes for a post or photo no matter how many times the post has been shared and reshared.
I want to know how popular a post is across the whole Facebook Universe.
Is this even possible?

This is not fully possible, for these reasons:
Facebook does not indicate via the API whether a post is a re-share
of another post (there is no "via" property on Post objects, in
other words). Nor is there a property that indicates where or how
many times a particular post has been re-shared.
Many posts on Facebook use privacy settings set by the user creating the post, and
this applies to re-shared stories as well. Your app has access to
whatever its users give it permission to read, but that does not
grant it access to the feeds of all users on Facebook.
At most, you could theoretically do this (although I am not sure if there are other limitations in place to prevent this):
Search all PUBLIC posts on Facebook, for text that matches the text in the post you want to track. (see the documentation under "Searching" here: http://developers.facebook.com/docs/reference/api/). Aggregate the Likes for all of these posts. Just understand that this is only the subset of posts that your app is capable of viewing.

Related

In general how are likes and recommendations usually handled on sites like Reddit, YouTube, and Facebook?

For example when you hit the like / upvote button it affects the future recommendations you receive.
At a high level how do sites determine all of this information?
Every time you hit the like/dislike button does it automatically make a call to the backend and update your recommendations list?
Or does it wait a bit before it does that in case you hit like by accident? What would happen if you just spam and keep liking and unliking a particular video or post?
this is done by many ways:
FaceBook:
1- when you stay reading the post for a long time or hit like, then you are
interested about the content that is offered in this post.maybe in the database there are categories for the data related to posts and offers according to it. also facebook has strong backend which can analyze photos and according to it's data, it may save it in the DB. this is done by image recognition using python. most people also allow facebook accessabilty for apps on their phones, this allows facebook to collect data about your interests. recommendations also based on your FB data, like age, location, friends and other data. when you admire something, the next time you refesh or opens facebook, a call to backend is made and then it returns data according to some cases according to user data and specifications.
Reddit
this mostly depends on text analysis because it is mostly reading posts. and by the same way like facebook it shows data
YouTube
here it maybe a little bit different because here the backend will analyze the videos you watch, channels, and other videos related json data (if you have dealed with yt_dl you will understand me)
you asked about when will the user preferences be updated?. i think this is done when you refresh or open the app again

Facebook API - Top 5 users for engagement and likes on fb page

I am trying to construct a Top 5 of engaged users and users that liked something on my Facebook page(a non-profit)(for instance posts, links or images). It has to be an aggregated total of engagement and likes for all items on the page per user.
Can anybody provide with some clues as to which Facebook API calls I could use for this. At this moment I am only capable of determining which users liked the page, or a particular post.
If the question is too general or anything else, I'll gladly modify it. I would have liked to attach image for clarification, but is not a possibility for me yet due to reputation score.
The only way to do this is to get all likes/comments/whatever from every single post with the API, store the numbers in your database and compare User IDs. You would have to keep it up to date too, so you would need to refresh your database entries from time to time.

disabling facebook comments with actions field on wall posts

My app allows users to interact with each other for a unique purpose. As part of this experience I post on user's wall so his/her friends can know about the post from user and they can come to app for interaction. But in this case, users may just end up commenting on the facebook page itself and my app will not have any knowledge of this interaction. To avoid this, I am wondering if I can disable comments on this post. Graph API documentations states that I can use the "actions" field on wall post for such purpose. I tried that with various combinations of Comment and empty link or link that takes the user to my app etc. But I notice that no matter what I set, facebook always shows link to the wall post instead of what I tried to put.
Any thoughts on how to achieve this purpose?
Thanks.

Can we get People Talking About This for a post?

Is there a way to get the "People Talking About This" statistic for a specific post on a Facebook Page ? The Insights API doesn't say it's possible. ( post_storytellers doesn't exist )
'People Talking About This' aggregates various interactions into a single metric including:
liking a Page
posting to a Page’s Wall
liking, commenting on or sharing a Page post (or other content on a page, like photos, videos or albums)
answering a Question posted
RSVPing to an event
mentioning a Page in a post
phototagging a Page
liking or sharing a check-in deal
or checking in at a Place.
As far as i'm aware there's no way to retrieve this value using the graph api without scraping the page directly.
You can however retrieve the total_count for a url which is an aggregation of shares, likes, comments via FQL, for example: https://graph.facebook.com/fql?q=SELECT%20total_count%20FROM%20link_stat%20WHERE%20url='https://www.stackoverflow.com'
more info: https://developers.facebook.com/docs/reference/fql/link_stat

Getting which users shared a post

With the graph api, when I query for the feed of a user or page, there are some posts that have been shared by users, and I can see the data about the number of shares within the data section of one entity:
"shares": {
"count": 2
},
When browsing facebook, on that post, when I click on the icon that represents "show shares", something pops up that lets me see some users that shared the post, according to the comment "You can see only shares that are public or from friends."
So is there a way to get the user data from the shares with the graph api?
The API doesn't provide information about users who have shared a post / link. Its probably something they will add in the future, but it's not possible at the moment. Your best bet for this information is to scrape the UI to get this information, but you will run into lots of issues and it's probably not worth the effort.
Facebook does give information on who Likes and Comments on posts however, if its any consolation.