Collect all public posts in facebook using graph api - facebook-graph-api

I am trying to collect all public posts from facebook using Graph api like twitter streaming.But i couldn't find out a way, i checked the graph api search function
https://graph.facebook.com/search?q=anyword
it needs a parameter or keyword for search, but i need all the public posts not specific to any keyword or any user or any page. Please help me to find out this.

It is not possible to perform such a vague search. Any type of search query require at least one parameter / criteria to be search. Even if had been possible, it would be like receivind millions of arrays in a single objects(which is practically impossible)
In your case it should be all the posts from a single user, a group or a page. You can receive real-time updates from the Graph API, but that too needs the object to be subscribed to other objects. Check the following link.
Real Time Updates

Related

Facebook Graph API Search Posts for specific text in message field

Is there a way with graph facebook to search specific text content in the message of a user's posts? The assumption here is that the user id and access token is already available as well as all applicable permissions (ie. the user_posts permissions, etc..).
I read through the search feature on graph:
Facebook Graph Docs-Advanced
The following graph explorer example was provided:
GET graph.facebook.com/search?
q={your-query}&
type={object-type}
The table that lists the available types in the link provided is very limited (place, placetopic, ad_*). Is that the full list of possible types? Can we use POSTS or user posts as a type. I couldn't find the right syntax anywhere.
My goal is to retrieve a user's posts based on a specific message tag or text in their post message. Currently, the only way I know how to do this is highly inefficient. I would have to do the following:
Get user's full list of posts
https://graph/facebook/com/{version}/{userID}/?fields=posts&access_token={token}
Run a coded query to get the posts I need and discard the rest
Thanks in advance.

Facebook Graph API to search user statuses

I am trying to pull some of my facebook statuses that contain a particular keyword and show them on a web page, what is the url query string I should use?
The best I can came up with is graph.facebook.com/me/statuses
But it returns all the statuses, but i want statuses that contain a particular keyword, such in a search, how should I do it? Or is it even possible?
You'll have to manually go through the statuses returned from /me/statuses to find the ones that you care about. Facebook doesn't really let you use their computing power to search stuff like that.

How to get Open Graph objects associated with an application or Facebook user?

I recently set up a Facebook application so that I might be able to send messages to people who 'like' things). I managed to figure that part out, but now I'm stumped again.
As far as I have seen, every open graph object that is created will have a reference to a app_id if the page had a fb:app_id open graph meta tag. However, I haven't seen anything in the Open Graph API that allows me to get a list of Open Graph objects associated with an app_id (this question has some insight, but doesn't provide a lot of information).
Alternatively, since I know that the pages will have a similar URL, I was investigating FQL to see if it is possible to find pages where the URL matches some pattern (either using strpos or the IN operator). No luck there either (condition fields needs to be indexed).
Lastly, I considered using the fb:admin metatag, because apparently it is possible to see which pages a user administers. In this case, I haven't figured out how to become administrator of the Open Graph object, so I am again stumped.
Is there any way, however roundabout, to get open graph objects associated with a Facebook application or user?
There's no way to get a list (from Facebook) of objects it knows are associated with a given app_id. Facebook only "knows" about your custom OG objects when it crawls them, and its only going to crawl them in when an action is taken with your OG object as a target. The best way to keep track of OG object for a given app is to track the result of OG API calls that create these actions (you'll get an fb_action_id).
Same with users. You can track which users are associated with your App in response to successful calls to FB.login or FB.getLoginStatus. You'll need to track actions taken by that user yourself.

How To Get Historical "Facebook Page Likes" Data via Graph API or FQL

Was wondering if anyone knows how to get the historical data for any Facebook Page.
For example, number of fans for RedBull fan page on a given day in the past or for a given period that ends today so that I can show fan development of any page over a given period.
I tried it with the graph API and FQL (insights) but no luck.
https://graph.facebook.com/{USERNAME}/insights?fields=likes&period('week')&end_time_date('2011-06-26') --> empty result
Pulling the data via FQL also returns no results, plus it seems without a read_insights permission nothing is possible for page data
I'd need this to be available with only a generic user access token. This data is publicly available anyway. Result should be somewhat like this: http://www.socialbakers.com/facebook-pages/australia/
https://graph.facebook.com/{{pagename}}/insights/page_views?access_token={{access_token_key}}&since=1420070400&until=1421625600
Since & until parameter in the above code takes in unix time.
add necessary information in the {{ }} and this code should work.
Without insight permission I recommend that you write something to perform a nightly query on the page graph and record the stats you need. If the page is public most of the information shown on that site is available.
You could also scrape info from http://pagedata.appdata.com if the page has already been listed...

GRAPH API - retrieve Posts on a fan page

I am using the Graph API in order to obtain public posts which contain the keyword passed as query parameter (the call syntax is like this :
https://graph.facebook.com/search?type=post&q=%22bwatcher%22&limit=50`)
By reading the results, I think that I only retrieve public statuses.
I wonder if it is possible to obtain some posts on a fan page or a group (considering that the fan page and the groups are public)?
Updated edit from OP
What I would like to know is that if there are conditions or parameters that make the publications on a page fan wall or on a group wall available by querying the graph API ? (Is there a number of fans required, a number of group members ? Are there some privacy settings which make publications unavailable thanks to the graph API ? Are there page fan categories for which publications are avalaible are others for which they are unavailable ? etc...).
Yes, if you have the object id then you can just get the feed and other connections for it. It needs an access token though, so you have to authorize a user for it.
http://developers.facebook.com/docs/reference/api/page/