Im trying to get Facebook comments using the Graph Api.
I've researched online and found an example that works but there's one thing that about it that I can't find any information about it.
Here's the Example that works:
https://graph.facebook.com/19292868552_118464504835613/comments?access_token=ZZZZZZZ
https://graph.facebook.com/XXXXXXXXXXX_YYYYYYYYYYYYYYY/comments?access_token=ZZZZZZZ
How do I get XXXXXXXXXXX_YYYYYYYYYYYYYYY ?
Is it the UserId concatenated with the Comment Id, is it returned by the Graph Api?
Why is there practicaly no information on this?
In the case of getting a page's post_id you can make a call like this to get the post_id.
https://graph.facebook.com/v3.2/{pageId}/posts?access_token={accessToken}
post_id looks something like this - 5704324444475_570454233326 and is in the id field of each returned post.
To get all comments for a page first you need to make a call to get all your posts and then make a call for each post to get comments.
Related
I'm having good luck using python and the FB graph api to collect reactions, comments from Facebook posts however, I'm having trouble targeting this specific photo link:
https://www.facebook.com/SheShopped/photos/a.432191143458704.110954.428340903843728/1367643623246780/?type=3&theater
Can anyone tell me how to deconstruct this link into a FB graph query?
If you want to look at the comments of this specific photo you just need to extract the id from the link (it's the last segment of the url) which is 1367643623246780. You'll find the comments at 1367643623246780/comments:
If you want to find this picture and others like it, you need to notice the type of picture (it is a 'Timeline Photo'). Looking at the relevant API-Documentation (Open Graph Page Photos) these can be found at 'SheShopped/photos/uploaded':
Im trying to read the facebook posts from our wall and we decided we dont want all of the posts, we just want some of them. So basicly our idea was to add a special keyword (for example: "#keyword") to each post, and then simply search for all posts that contains the keyword. I dont know if theres a smarter solution, if there is any let me know :)
What i used before:
https://graph.facebook.com/<OurID>/posts?limit=15&access_token=<privateToken>
Now i found a way to get that what i want, but its using the FQL:
SELECT message
FROM stream
WHERE source_id = <ourID>
AND strpos(lower(message), "#keyword") >= 0;
I heard that the FQL is going to be removed soon. So is there a way to convert this FQL into the Facebook graph API?
As solution i just gather all the data and filter them by myself via CRON-Job.
We are trying to poll recent comments for a fb page. It appears that using graph API requires a separate call per post (e.g if there are 100 posts we'll have to do 100 calls to retrieve the comments of all posts).
So, we're using FQL in the following way:
https://api.facebook.com/method/fql.query?format=json&access_token<acess_token>&query=SELECT id, text, post_id, fromid, username, time, likes FROM comment WHERE post_id in ('156790397738497_357582840992584', ...)
Most of the time it works fine, but we've found several cases where it does not return all the comments of a post (using the graph API for the specific post id does retrieve all posts).
Has anyone found any solution to this or a better way to retrieve all recent comments of a page?
We've filled a FB bug (http://developers.facebook.com/bugs/529168040436289) but they don't seem to be willing to investigate it.
This is a major problem for us too. This really should work. Slightly disappointing that something as important as this is not supported by FB.
I'm trying to make a small button in an Android app that lets the user like a wall post. I would like it to show if the user has already liked the post so the user knows that it's worked. The API here:
https://developers.facebook.com/docs/reference/api/post/
shows how to add and delete a like for a particular post but there doesn't seem to be a way to query the like state.
Calling:
https://graph.facebook.com/me/likes/19292868552_10150189643478553
seems like the obvious solution but this gives a parser error.
There IS actually a solution for this. You have to use FQL. Here, this is what will work
select user_id from like where object_id=your object_id AND user_id=me()
If the result returns an empty array, then the user never liked the post, if it returns a result, the user has liked the post. Simple :)
i think you want this: https://graph.facebook.com/19292868552_10150189643478553/likes ... or did i misunderstand?
I'm starting to use the Graph API to get my notifications, and in the REST interface, they had the object_id field. I used this to get the notification objects' id to then query the Graph for more information.
The Graph API object does not include this information.
Example of what I want to do:
Get user's notifications JSON object.
Grab single item
Identify if this item supports commenting/liking
Display comments and number of likes for that item
if user can comment or like item, display buttons for this
my process:
call me/notifications/?include_read=1
is pretty easy to do.
I can identify if the object refers to a group, event, random application, post, or photo using the URL. I know that posts, likes, photos and others support commenting/likes so I have a way of doing this, though it involves parsing the link attribute of the item
this is what I need help with. I can get the id of the object by parsing the link, but I don't get the full object some times using this. For example, to post on a comment, you need to have USERID_COMMENTID and the link only has the COMMENTID in this form http://www.facebook.com/USERNICKNAME/posts/COMMENTID
I also need help with this. I guess some fb objects can't been liked via the graph?
any help would be great!
The notification FQL table, which also replaced the REST notifications.get API, still has an object_id column. That's the closest thing that exists to what you're asking for. It doesn't look like the Graph API call is documented to have the object_id field unfortunately.