Graph API does not showing all public Posts based on keywords - facebook-graph-api

I tried searching all public posts using "https://graph.facebook.com/search?q=keyword&type=post" as mentioned in the documentation. But the JSON result is missing some posts which are public. For example i posted or shared something on my wall and i tried searching d post having specific keyword using the above api but it did not show my post. I tried finding the reason for this problem but i could'nt get it anywhere. So friends if u know the reason or solution of this problem then please do answer.
Thanks in advance.

Related

How to exclude retweets and replies from Twitter API Full-archive search

I am trying to extract some historical tweets using twitter API. And I want to exclude retweets and replies. I tried other suggested answers here but nothing seem to work. Can someone please help me, I am struggling since a week to find the resources. Below is my endpoint for Full-archive search.
https://api.twitter.com/2/tweets/search/all?query=MMIW OR MMIP OR MMIWG&start_time=2015-01-01T00:00:01Z&end_time=2015-01-15T23:59:01Z&max_results=500&tweet.fields=created_at,entities,geo,id,referenced_tweets,in_reply_to_user_id,lang,possibly_sensitive,source,text,withheld&place.fields=country,full_name&user.fields=created_at,description,location,name,pinned_tweet_id,username,verified,withheld
Okay, so I figured out from twitter's rules and filtering operators from the link below:
https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product
i just had to add and negate the is:retweet operaor in my query field.
Ex: query=(MMIW OR MMIP OR MMIWG) -is:retweet
So, my modified endpoint that worked:
https://api.twitter.com/2/tweets/search/all?start_time=2015-01-01T00:00:01Z&end_time=2015-01-15T23:59:59Z&max_results=500&tweet.fields=created_at,entities,geo,id,lang,possibly_sensitive,source,text,withheld,in_reply_to_user_id,referenced_tweets&place.fields=country,country_code,full_name,geo,id,name&query=(MMIW OR MMIP OR MMIWG) -is:retweet&user.fields=created_at,description,location,name,pinned_tweet_id,username,verified

Getting the facebook graph to only return results with a # symbol in it

Any one have any ideas on how to accomplish this?
I have tried
https://graph.facebook.com/search?q=%22%23apple%22
https://graph.facebook.com/search?q=%23apple
https://graph.facebook.com/search?q#apple
which does not work.
To be clear the results should only have posts that contain #apple not "apple".
Facebook says this is not supported at this time: https://developers.facebook.com/x/bugs/313941462054417/
if you're trying to get the #hashtags from Facebook, currently, there is no api for this. and even if there were- the posts are not intermediate, they are being cached. you won't see the most recent hashtag from a person who's not in your friendlist right away, this will take a long time to appear in the hashtag search
I've read too that it's not supported but,
trying the second line of jlarry
https://graph.facebook.com/search?q=%23apple
in Graph API Explorer, it works.
obviously the query is on the posts set as public.
so the query could be something like this
https://graph.facebook.com/search?q=%23joviberton‬&type=post
for further ops check https://developers.facebook.com/docs/graph-api/using-graph-api/

iOS tag friend in status update

I'm currently using iOS Facebook SDK 3.1. To post a feed story to a users timeline, when on < iOS 6, i've been using +[FBRequest requestForPostStatusUpdate:place:tags:]. This works great, except when I attept to tag a friend [such as I would when typing #FRIENDS_NAME on Facebook.com into the composer. I know that I can pass an array of objects to the tags: argument, however, as I expected, also passing nil to place yields an error (#100) Cannot specify user tags without a place tag.
For sake of completion, here's an example of what I was using:
NSArray *tags = #[#(FB_UID)];
[FBRequestConnection startForPostStatusUpdate:#"Friends Name, this is a test"
place:nil
tags:tags
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
}];
Now I understand that using this method, it's not possible to tag a friend in my status. However, is there a method, any method, using the graph API to tag a friend in a feed post, the same way it'd work tagging a user on Facebook.com? I've spent the better part of this morning looking for answers, and i've yet to find any solutions. Any questions i've found on it seem to be at least a year old, so I wasn't sure if they were still relevant anyway. Any assistance would be greatly appreciated!
However, is there a method, any method, using the graph API to tag a friend in a feed post, the same way it'd work tagging a user on Facebook.com?
No.
I've spent the better part of this morning looking for answers, and i've yet to find any solutions.
That’s because there are none – Facebook deactivated this feature for posts made via API quite a while ago.
For Open Graph actions, the situation is different – the allow something called mention tagging.

What types of posts are in a feed?

I was wondering what all the possible types of posts I can expect in a feed. The documentation at http://developers.facebook.com/docs/reference/api/post/ mentions that the type field could be link, video, and photo, but that's clearly not a comprehensive list. I know that there are at least the following possible types (because I've seen them): status, link, video, photo, checkin, note, swf, and music.
But are there more that I'm missing? Is there a complete list of these types somewhere?
I know of someone who says that they've seen event attendance and friendship acceptance posts in their home feed (from /me/feed), but I can't seem to recreate that. Are those also types of posts that I could expect?
It appears that currently there is no official list from a FB resource. The closest thing I could find was a related StackOverflow question
I would suggest reaching out to their developer community directly, and, of course, providing a link here once you've done so!
As of 2013-12-18 the documentation says:
name: status_type
description: Type of post
permissions: read_stream
Returns: One of mobile_status_update, created_note, added_photos, added_video, shared_story, created_group, created_event, wall_post, app_created_story, published_story, tagged_in_photo, approved_friend
Doc reference
You can find a list for Graph v4.0 here (search for status_type):
https://developers.facebook.com/docs/graph-api/reference/v4.0/page/feed
The type of a status update. Values include:
added_photos
added_video
app_created_story
approved_friend
created_event
created_group
created_note
mobile_status_update
published_story
shared_story
tagged_in_photo
wall_post
Though these are listed for Page feed documentation, but I guess it's the same for others as well. I couldn't find it any place else. Also note that mobile_status_update is a legacy one kept for backward compatibility. See this: https://developers.facebook.com/bugs/564448573658836/

How can I retrieve all comments on a Facebook post using the php SDK?

I'm building an app which allows users to post articles to their facebook wall. When an article is posted, I retrieve the post id and store that in the database along with the rest of the article details. Now I want to be able to show the comments made on that post when someone views the article in my site; I would also like to allow users to add comments to the post from my site.
I know that the user is always logged into Facebook when they are viewing the article, as the system checks for that earlier on.
I've been using the PHP SDK, and thought all I had to do was something like:
$post_comments = $facebook->api('/' . $post_id . '/comments');
However, when I do this, I get the following error:
Fatal error: Uncaught GraphMethodException: Unsupported get request. thrown in /APP_PATH/facebook/src/facebook.php on line 560
I really don't have much of a clue what I'm doing here, to be honest, as I'm very new to the Facebook Graph API, and I can't seem to find a lot of documentation on it.
Can anyone tell me what I should be doing here, or point me to some documentation I could read about it?
Thanks!
It should work.
Here is the code I am using which is working for me.
$comments = $facebook->api($postid . '/comments');
Make sure your postid is a valid one.
Alternatively, you can directly type that url in browser to get details like this
https://graph.facebook.com/<postedid>/comments
Please refer this link for further reference
http://developers.facebook.com/docs/reference/api/Comment/
I don't know what your PHP library is doing, but you can actually access comments by reading graph.facebook.com/<post_id>/comments. Indeed, try with this one from the doc.
Are your sure of your post id? Try to call the buggy function with 19292868552_118464504835613 as post id. It has to work.