Facebook see who took my quiz - facebook

Our client would like to have a simple quiz that everyone can take, and if the user want, they can share the result on Facebook. Pretty much similar like this: http://www.whichblankareyou.com/q/which-alcoholic-drink-are-you
The only thing is; the client thought of randomly giving away a price to one of the users who shared their results on Facebook, this to encourage more people to really share their result (and thus generating more 'buzz' on Facebook about it)
Is it possible to do this? and if so: how ?

After your user posts a story a post_id is returned by the facebook and this is of the form-
userid_postid
So, you can fetch the id before _ and that will be the id of the user who shared the story.
Hope that helps! :)

Related

How to get the facebook user id that likes my website (not a facebook site)

I am making a raffle within the people that had make an "I like" to a certain article of my external website (non facebook). In order to choose the winner I need to know who has made the I like.
This query:
https://api.facebook.com/method/fql.query?query=select%20like_count%20from%20link_stat%20where%20url='myWEBSITE'&format=json
Only get me the total count of I Likes but not the users ID
This query is perfect:
https://api.facebook.com/method/fql.query?query=SELECT%20user_id%20FROM%20like%20WHERE%20object_id%3D%MY_object_ID&access_token=MY_ACCESS_TOKEN
But how do I get an OBJECTID for an external url??
Thanks in advance
Object can be any thing like video, note, link, photo, or album but can not be any FB page or Url.. So I guess its not possible to get the user Id for a URL.
If you are using JS SDK / Like plugin in your website to like it, i think you can subscribe to an event and then use some ajax calls to get those userIds whenever they instantly like it.
See Somnath Muluk's answer in https://stackoverflow.com/a/13467793/269521

In Facebook, How to got "all users" who likes my post?

I use Graph API Explorer to get who is like my post..
but the worst case is, if someone like my post again, the previous user will not shown again..
How can I got all the users who like my post??
I want to know all the users because I want send messages to all people who like my post..
Is that others way to do my idea?
Thanks
Try graph.facebook.com/post_id/likes
This will give you all the people who liked the post with post_id
https://graph.facebook.com/v2.9/POST_ID/likes?access_token=PAGE_ACCESS_TOKEN
this will give you all the users who liked your post with all there specification
try hitting it once

good way to let users search their friends on my fb app

I want to let my users search(not browse) their friend on my fb app. What is the best way?
I have surveyed this issue for hours. I got two ways:
use Graph API:
https://graph.facebook.com/me/friends?access_token=...
by this way, I can get the friends of user as json, and by parsing the json, I can get the one who is the user's target.
However, there are two issues.
First, user need to input the exact name of his/her friend. For example, my app can't find "Steve Jobs" with "Steve" by parsing json.
Second, if the user has a lot of friends, the cost of parsing json may be terrible.
2.
use the searching api:
https://graph.facebook.com/search?q=mark&type=user
by this way, user can get "Steve Jobs" with "steve". However, it is obvious that users may find someone who is not their friend.
I think neither of these ways are ideal enough. Any suggestion?
Thank you sincerely!
How about this: Request dialogs
https://developers.facebook.com/docs/reference/dialogs/requests/
--
For Search Partially, may use indexOf function to check whether this string is match

How to check if a Facebook page post shared by a certain user?

I need a way to learn if a user had shared a post (link, video, photo etc.) which is published by a Facebook page. I have the object_id and link of the post, and user_id of the user considered. Is there a Graph API or FQL (or something else) solution to ask Facebook if the user re-shared the post or not? Or is it possible to get a list people who shared the post? So, I can extract my answer from this list.
Note that I know it is possible to find the answer by crawling the user's wall feed. But it is time consuming and I need a more efficient way.
Thanks in advance.
You can use the following FQL to get the data you're looking for.
SELECT via_id, created_time, owner_comment
FROM link
WHERE owner = me()
You can then compare via_id against the posts author (page ID) to determine if this share came from the page in question.
Unfortunately, there seems to be a bug with the data return where some of the via_ids come back as 0. There is a ticket in with Facebook which, at the time of this post, has been open for three weeks at medium priority. I have no idea if this issue is specific to my app or affects everyone, but that's the query to get what you want.

How do I get a list of friends who clicked "Like" on an external page?

PART A -
There are many many questions like this, but none of them seem to provide a working solution. I want to get a list of friends who clicked the Facebook "Like" button on an external site.
NOTE: This is NOT for a Facebook page. In this case, I know I can query the page_fan table.
To get the list of Facebook page-likes for example, I can use the url_like table. I guess I just want a way to invert this table. I know I cannot get a list of ALL people that liked a link due to privacy concerns, but I want a list of my friends alone - which should be fine.
I know facebook does this internally every time I see a Facebook Like button... right below that there is statistics about my friends that also like the same link. How do I get this using FQL?
PART B
Equivalently, how do I get a list of friends that shared a specific URL as a link? I cannot search the link table by url because that is not indexed. Also, the link_id is not the same as the Open Graph ID of the URL.
I tried select link_id from link where url="http://urladdress.com/a/b.html" and owner in (select uid2 from friend where uid1=me()) but that neither throws an error not returns anything... just stalls.
Part A: you can't.
Part B: you can't the way you are trying. You might be able to get the feed for every one of the users friends and look for that url from their feed, but it will be painfully slow.
Lots of people would like to know this but Facebook is (rightfully so) not giving this information out. That is why you see lots of questions regarding it but no working solutions.
You could possibly look into the read_insights permission. You might not be able to get the exact information about "likes" (yet)... but you will be able to get other possibly useful information.