Get all Posts and Comments made by "me()" - facebook

i am trying to retrieve all posts and comments "me()" created. But I dont find any way to do this. There only seem to be a way to retrieve the posts on the "me()"'s wall - but no way to retrieve all posts created by "me()" on the walls of other users.
The obvious way would be to use the actor_id field in the streams table, but thats not indexed, so the query wont work.
Google didn't return a solution either - even through i expected this to be a common problem ?
I already know how to retrieve all statuses and likes but posts and comments seem to be unsolvable...
Any Ideas?
Thanks

https://graph.facebook.com/me/posts will return what you're looking for.
You need the read_stream permission to access this resource. (documentation)
You definitely want posts of type status and wall_post.
Currently, there doesn't seem to be a way to retrieve the same data over FQL.

Related

getting only the posts that have location data

I am trying to get the posts of a user only if those posts have location data. location is nested under place in user's `posts'. How do I write a graph api query that would get me all the posts of a user ONLY if those posts have location?
With this query, https://graph.facebook.com/v2.3/me?fields=id,name,posts.limit(25).until(1399832709).with(location){place}, I am getting what I want, but only a subset of the total. I know it's subset because it's only returning 2 posts with location data when I know there are at least 50 posts. So I thought if I removed limit(25).until(1399832709) from the query, it would now give me all posts that have location. But nope. I get absolutely nothing back.
Could anyone please advise on how I can structure the query correctly? If there are facebook engineers out there reading this, please help! Thank you very much.
I think the problem might be the {place} at the end. Have you tried
/me/posts?with=location&limit=50&until=1399832709&fields=id,place
Furthermore, as far as I know, if you remove the limit parameter, it will apply the standard limit, and not show all.

Facebook Group Search post without comments

Hi,
As title, in my facebook group, I need to retrieve only post without comments.
I see the search box and notice that searching something will give an url with
`?query=Word%20Search`
and maybe there is a way to search post without comments by url.
Thanks for help!
You must use the Graph API to retrieve data from Facebook. There is example code how to get the group feed in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed#read
You canĀ“t filter by posts without comments, you need to do the filtering on your own after getting the posts.

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.

Get the comment of a specific User- Facebook API

I want to get the list of comments made by given user through Facebook Graph API.
I haven't found any direct way to get lists of comments. So, I tried to find them through my feed, but it's returning all feed posts. Can we filter other posts where I have not commented?
I tried various queries as below, but could not get exactly what I need.
/me/feed?fields=comments?fields=from?name="my_name",message
/me/feed?fields=comments.fields(from.name("my_name"),message)
I need either (1) list of all comments by me or else (2) lists of posts which I have commented on, filtering out all other posts.
How can we do this?
There's no way to filter via the Graph API. Basically what you want to achieve is IMHO not really possible.
What you could theoretically do is use the comment FQL table, but the field you'd need (fromid) is not indexable: https://developers.facebook.com/docs/reference/fql/comment/ So this could be tough.

How to retrieve the comments or at least the number of comments hidden on a Facebook post?

I'm trying to retrieve the comments marked as spam/hidden or deleted by the admin of a page.
I can't find a way to do that.
Please help!
if its not in facebooks API documentation then I dont know what to tell you, you most likely cant do it. I would think that stuff that has been deleted is only accessible if your Zuckerburg.
Have you tried using FQL. Try querying FQL comments table.