Facebook Graph Check-In Count - facebook

This is a kind of 2 part question...
what i need todo is get a count of the amount of people checking into a facebook page. (users who have checked in via facebook places on their mobile)
question number 1, is it even possible to get this information? I have looked through the data returned when you do a query on the public information of a page (for example: https://graph.facebook.com/126049473493) but this doesn't seem to have the data I need....
Question 2, is how would I go about doing this? I am new to the whole FaceBook API, so need some quite detailed help in regards to this problem...
I hope someone is able to help?
Many Thanks!
Tom Kirby.

Related

FB graph API problems with reading posts (type=status)

I'm trying to analize a large number of posts from varoius pages for my bachelor thesis. Therefore I'm using a tool called Facepager which uses the graph API to fetch data from Facebook.
I need the following data:
id, link, type, from and the count of likes, shares and comments (just the numbers, no further info!). In general, everything is working just fine, only posts classified type=status behave strangely. For some of these posts, there is no data shown about like, share and comment counts, further more there is no link given. But as mentioned before, this only happens sometimes! I searched for the affected posts manually on facebook and some of them had a large number of likes, shares or comments.
I also tried to fetch data with graph API explorer with similar results.
Is there any reason why it isn't possible to get share, like and comment count on some of the posts classified type=status?
Additionally, I'm planning to use the ID or if invalid, the link to open specific posts in my browser. This is not possible for some of the status posts either.
Sorry for that newbie question, it would be amazing if I could get an answer because at the moment I am quite desperate because this is really important for my bachelor thesis. Thanks a lot!
Because this kind of post is a post which "CAN NOT BE VIEWED".
ex: "xxxx likes a link", or "XXX commented on a post".
I suggest that you should filter out these posts by yourself.

How to get all user's likes using facebook's graph API

How can I query facebook's graph API to retrieve all user's likes (not only pages but also photos and others)?
For instance, how could I get all the pictures a user has liked? Using facebook's search bar you can find them easily by clicking on "photos has liked".
I wrote a script that scrapes the page content and does that but it's not very efficient.
I have recently come accross a similar problem, maybe this helps you solve it.
https://graph.facebook.com/v2.5/{page_id}/feed?fields=likes.limit(1).summary(true)&since={start_date}&until={end_date}&access_token={access_token}
This will give you a list of all posts that received likes during the specified time period. If you manage to write a code summing up the following JSON path you got your sum for "all user's likes":
data[0].likes.summary.total_count
Not entirely sure is this is exactly what you were searching for, hope it helps you though - and if not you, someone else.
As for likes you can also use the same way to extract Shares and Comments:
Shares
https://graph.facebook.com/v2.5/{page_id}/feed?fields=shares&since={start_date}&until={end_date}&access_token=
Comments
https://graph.facebook.com/v2.5/{page_id}/feed?fields=comments.limit(1).summary(true)&since={start_date}&until={end_date}&access_token=
Best regards
There isn't to my knowledge any way to get this from the API without grabbing every type of response from the API and then sorting through for likes. Facebook search bar uses an internal API different from the Graph API.

How to remove a Facebook page's fake likes

There's this company that has a very annoying problem. For some reason their Facebook page started generating a lot of likes. The numbers go up to 10K new likes per month.
As these likes all originate from India, it takes no genius to figure out these are all fake likes.
Obviously this is quite an inconvenient situation, because this doesn't really add any value to the company's credibility. Maybe these likes were bought by a competitor to crank up the Facebook advertising costs...
I've searched everywhere, but there doesn't seem to be a solution to somehow programmatically remove the fake likes from the list. I very well understand that there possibly is no way to mass remove all of these likes, so I'm using my last sprinkle of hope to turn to you guys.
Has anyone come across a way to do this? I would love to hear all about the community's ideas about this problem, I can't be the only one suffering from this problem.
Thanks in advance!
Perhaps not quite what you're after but here's the link to remove/block a fan from your page:
http://facebook.com/ajax/pages/fanlist/mutator.php?page_id=[PAGEID]&user_id=[USERID]&act=remove
If you could get a list of fan ID's that are fake and your page's ID a simple foreach loop, posting to that URL might do the trick.
Just for clarity, here's a PHP snippet (fill in the blanks yourself):
function postToFacebook($friendID){
...
// cURL exec
...
}
foreach($friendArr as $curFriend){
postToFacebook($curFriend);
}
This is assuming you have the friend ID's in an array which wouldn't be too difficult to get.

How to know your 1000th like on facebook?

This might not be a development issue, but I'll ask it anyway, maybe there's a solution with Facebook Graph API.
Basically, I want to know who the nth (1000th, 2000th) 'like' of my page was, this is to give a prize or something like that.
I've seen a lot of pages who give prizes to their fans like this, so it must be possible.
If the above isn't possible, I'm also happy to know the 5 or 10 last likes.
Any answer is much appreciated, thanks!
This appears to be a dupe question. Please see: Getting the Nth user who like a page I am the admin of on Facebook
Also this is a bug in the API. https://developers.facebook.com/bugs/231272073596022
However, with that said, you can get to the last 500 likes via:
http://www.facebook.com/browse/?type=page_fans&page_id=[PAGE_ID]

Facebook and suggestions

I'm trying to write a simple application that finds out who liked your page. I used FQL and a query very similar to:
$query = 'SELECT user_id FROM like WHERE object_id="149187568469862"';
The first issue is that FB returns an empty array. Maybe the data will be available in the near future.
I will describe the most important issue. If the user X liked my page, I would like to know who suggested X to like my page. Maybe nobody, but there are chances that X pressed "Like" after a suggestion coming from a friend. I browsed the documentation, but I didn't find relevant information about how can I see who liked my page as a result of a suggestion. Do you have any ideas?
Thanks,
As far as I know you can not retrieve any historical information on who referred a "like". Furthermore, as of right now facebook does not seem to allow querying for all your pages "fans" (which is basically everyone who likes your page). They do, however allow looking up all pages that a user "likes" using fql. Much of their documentation is very "skinny" on examples. I actually learned the most by downloading the facebook connect javascript toolkit which came with some client side examples of the most used functionality. https://github.com/facebook/connect-js - this may be a good place to start