Facebook Group Search post without comments - facebook

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.

Related

How to get the Facebook "HashTag" feeds/Posts etc using the Facebook Graph API ? I want to get all the posts of a particular #HashTag

I have suitation, where i have to get all the posts of Particular HashTag of Facebook. eg #ILovePhp . I have done some R&D and got my own profile hashtag posts/comments in format of JSON. But i want all the Posts of the particular HashTag(i.e a user who is not friend at all to me in facebook still he posted some message using the hash tag #ILovePhp) . I want to get all the posts in Facebook related to a particulat HashTag. Please help me.
Public Post Search has been removed, there is no way to get all posts of a particular hashtag anymore. You can read more about that in the changelog.

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.

Facebook Graph API: Get post/status attached photos

How can one get multiple attachments of a post/status in a group?
For example: A group status that some member wrote and added multiple photos to..
Currently I am using Graph api to get the group stream with group_id/feed and unable to see images attached to a single status - while accessing the feed from Facebook itself I can validate that there are few photos attached to the status.
Using FQL it is possible to get the attachments with the following query:
SELECT attachment FROM stream WHERE post_id = each_post_id
Considering I will have to send this request per post and that FQL will soon be gone I am searching for an alternative.
I was looking for a solution for this as well and actually just found it.
The Facebook Platform changelog says the following:
/v2.1/{post-id} will now return all photos attached to the post: In
previous versions of the API only the first photo was returned with a
post. This removes the need to use FQL to get all a post's photos.
With this knowledge I went to the Graph Api Explorer and found a post that had 2 attachments or more added to it.
After finding the post, and with that the post id, I tried the request Facebook told me to do:
/v2.1/{post_id}
This does NOT give you the desired result. The nice thing about the explorer is that you can search for fields you want to add to your request.
You want to add the attachments (plural) field. NOTE: It might be that the graph api explorer only shows the attachment (singular) field. This is NOT right.
So, to summarize:
Get the post id of the post containing the images.
Create a new request to the graph api that looks something like: /v2.1/{post_id}?fields=attachments
Then read the result to get your desired attachments.
I hope this helps you out as I have been struggling for a while as well.
KR
PS: This is tested with a user and not a group, but it should be basically the same.
PS2: This is just an explanation of how you get attachments of a single post. You can also add the attachments field to the /me/home egde to immediately get all attachments at every post like so:
me/home?fields=message,from,attachments
PS3: The permissions you need are
user_status
read_stream
user_photos
user_videos
Facebook is not very clear on this matter and it is very hard to figure things out like this. So I hope this will help everyone that is searching for this solution.
I answered for the same question here : /v2.1/{post-id} does not deliver photos
It seems it's a Facebook bug. My colleague opened an issue. Here's the link: https://developers.facebook.com/bugs/762280800482269/
You also can find some info here:
https://developers.facebook.com/bugs/790976317600139/
Hope it will help you.

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.

Facebook API How to get a list of unpublished posts

I'm having a little bit of trouble getting a lists of posts of a page on facebook...
I'm using the url to get the posts of the page
string.Format("{0}/posts, pageid)
But I cant take the unpublished posts.. It only gets the published posts... Is there any permission I have to use... or some other parameter? I also tried like this
string.Format("{0}/posts?is_published=false", pageid)
... Didn't work...
Can someone help me?
Try the following
<pageId>/promotable_posts?is_published=false&fields=<the fields that you want>
at Facebook Graph API Explorer
Promotable posts include unpublished posts as well as regular posts. To get only unpublished posts, set is_published to false.
Fields are just comma delimited field names ex: fields=message,created_time,comments
Docs/source