Ways to query Facebook Graph "do I like x?" - facebook

I'm setting up my app to basically do what the FBML 'like' button does: like, unlike and show like count, for objects from the user's "me/home" stream.
I have no problem doing any of the above functions, but I'm having a very tough time getting the api to tell me if the user likes the thing already (so I can set the button to 'unlike'). The graph api is telling me I'm not allowed to search user's likes. Is there an FQL solution?
Thanks

There is like table where you can check through FQL if someone likes something.

Related

Facebook Graphic API 2.8: Get page posts by date/keywords?

I want to get a page's posts by facebook graphic api(2.8, without FQL),
I have page_id, so I write something like this on graphic api testing page:
{post-id}/feed?limit=100
I know facebook only allow we get 100 posts,
is there any other way to get maybe number 101~200 posts?
or setting a keywords parameters like
{post-id}/feed?limit=100&keywords=apple
or setting a date duration parameter like
{post-id}/feed?limit=100&date=20160101_20161231
I only use graphic api testing page, so if it don't have to write any other codes, it will be very nice.
Thanks
You can limit your result with until and since like this
me?fields=feed.since(2016-12-20).until(2016-12-25).limit(4)

Facebook Place Likes

I can't seem to find how to get facebook place's page like count via fql, anyone knows how this can be achieved?
I know this can be done with graph-api but I need it in fql since I already have a multi-fql query.
From the documentation:
There is a parameter called fan_count that contains the number of people who like the page.

graph api - retrieve list of likes of a page

I've been searching & found it's probably not possible.. but I thought I'd ask anyway:
I have this facebook page & I'd like to display the user-images(=avatars) of everyone who liked my page. I think it's really strange this isn't possible using the facebook API!
So basically I need to retrieve a list of users who liked my page. Something like this: (yet likes doesn't exist).
https://graph.facebook.com/page_name/likes?access_token=token
If I'd use the simple facebook plugin - it does display user images of people who liked my page.; so how come the plugin can retrieve these images but API can not ?
Any help is much appreciated!
thanks in advance,
Ben
There isn't an API call or FQL query you can call to get the list of users who like the page. Facebook has prevented this type of call for privacy reasons. You should stick with using the plugin instead.

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.

How to get category specific likes for a facebook user using graph API

I'm pretty new at this. I was playing with the Facebook Graph API and was able to pull all my LIKES using the call
$all_likes = json_decode(file_get_contents('https://graph.facebook.com/me/likes?access_token='.[access_token]));
Now when I display these, they have a field called category which has different values like TV Show, Book, Public Figure etc.
So my question is how do I get category specific likes - for instance I just want to fetch ALL the BOOKS that I LIKE
Obviously its possible to fetch all the likes and store them on the server side and work on it but the LIKES list is too huge for certain users and it doesn't make sense to pull everything if you just want to show a certain category.
I feel like I'm missing something.
If its not possible through the graph API call, then even a FQL solution is welcome.
Thanks for your time
R
You can use FQL, just like in this answer:
SELECT page_id FROM page_fan WHERE uid=me() AND type="MOVIE"