I'm looking to implement a feature where I am able to collect #mentions through the facebook API in a similar fashion to the twitter API.
Specifically, if I run a group called foo, and other people on facebook mention #foo in their wall posts, I'd like to fetch and collect the text of that particular #foo mention.
I can't find any relevant documentation on Facebook....
I think you cant do this, the privacy policy on Facebook is much tougher than Twitter. Even application which being installed need to explicitly ask for permission to read wall posts. if your application has read_stream permission from user then you can read his/her wall posts with API, and you can search for your group name there.
Related
I would like to get all the posts and updates that are normally displayed in FB official application for MY account (this includes updates from my friends and liked pages).
I wasn't able to find any details how to get that, the only thing I've managed to get is my own posts.
Anyone got any experience with that using current Graph API verion (3.3)?
All the alternate FB clients (ex. Friendly) must be doing this somehow.
There is no way to get ANY data of users who did not authorized your App. Which means, there is no way to get posts of friends. You can only get your own friends, with the user_posts permission and the /me/posts endpoint. If some Apps access friend data without their authorization, they are most likely doing something that is not allowed.
Here is what I found in their API docs:
There are two scopes:
The user feed requires the user's permission
The public feed has fewer capabilities but doesn't require perms
Using the current (v2.4) Graph api I can see a user's news feed at /{user-id}/home assuming I have the user access token and the read_stream extended permission.
As per the Facebook developer docs, "The posts returned by this API may not be identical to the posts a person would see on facebook.com or in Facebook's mobile apps."
Is there any way—probably undocumented because I can't find it in the official docs—to modify what is returned? e.g. to emulate the Show Most Recent Stories option on facebook.com?
Or to limit the posts to those published by white-listed users, for example?
(I would like to be able to access the public posts of a user's friend. I can't do it via the friend's {user-id}/feed even though the posts are public because of FB's privacy-related API restrictions, but I was hoping to be able to do it via the News Feed, which will only work if the full News Feed is available rather than the limited Top Stories feed returned by default.)
Note: I know similar questions have been asked on SO before but they either haven't been answered categorically or relate to earlier versions of the API.
Both /{user-id}/home endpoint and read_stream permission are deprecated, and will be removed for all apps (no matter what API version they are using) on October 6, 2015 – see https://developers.facebook.com/docs/apps/changelog#v2_4_deprecations
If you want to get posts by the user’s friends, then those friends have to become users of your app and grant it access to their posts first.
I don't know why they deny API access to content that is freely available on facebook.com
Presumably mainly because you are not a Facebook user here viewing content that other people have made accessible to them, but a 3rd party app developer – and in that capacity, you could do all sort of (shady) things with that data if it was freely available to you, like do extended social profiling, data mining, etc. Therefor users must now explicitly agree to share content with your app, before you can access it.
It’s also why they removed all friends_* permissions that existed previously, that allowed people to grant apps access to data belonging to their friends to a certain extend.
Basically it boils down to this: Whether or not a 3rd party app gets access to my data should be my decision, and not that of any Facebook friends of mine.
I would like to build a project to know users' behavior when they surf facebook website, especially the advertisements showing in their timeline wall. I have learned the basic idea of facebook graph api, knowing how to access the users' information and their feeds. However, I found that the feeds returned by facebook graph api is not "exactly" what user really see when they open facebook url in their browser. First, in graph api, it doesn't show the advertisements posted by sponsors. Second, the feeds returned by facebook api seem only regarding to my own posts(e.g. the photo tagging me, the posts tagging me). So, I would like to know how to access these information to rebuild a testbed that looks like exactly same as the real facebook website to record people reaction to it and continue my research?
Any idea is welcome ^^
This isn't really possible or rather I don't know any API (Facebook/Twitter/etc) that would do this to their third-party developers. The point of the API is to pull user data, not ads.
Also it sounds like you are using /me/posts or/me/feed instead of /me/home
I'm trying to find an API call (or set of calls) that will allow an app to get the posts that one would see if viewing a friend's wall. Either a REST call or a FQL call would do.
I tried /feed and /posts, compare the results with what I see on my friend's wall, and the results I get from it are incomplete.
I know this is possible because apps like Friendly are able to do it.
Any hints?
Well, there's two different API endpoints for querying the posts of a given user; home and feed. Home includes posts from other people and pages (basically what you see when you log in and go to your home page) and feed is the stuff the user is sharing. Assuming your application has authenticated the user and they've allowed the read_stream permission, you can then make queries to the Graph API using their access token:
https://graph.facebook.com/{SOME_USER_NAME}/home?access_token={SOME_ACCESS_TOKEN}
and
https://graph.facebook.com/{SOME_USER_NAME}/feed?access_token={SOME_ACCESS_TOKEN}
The only hint I could give you is that "incomplete" is pretty standard with the Facebook API. You can only do the best you can with what they give you. Counts will be wrong. Data will be wrong. It's a fluctuating, moving target, so code to that fact.
You can interact with posts by retrieving the read_stream and publish_stream for a given User's ID.
Once you have the ID of the User that you are interested in you can use FQL to retrieve posts from streams that you have the permissions for.
This stackoverflow answer goes into more detail and contains further links to the documentation on the Facebook Developers site.
We do it like this:
1) we use Facebook Platform PHP5 client
2) then what you do is:
$this->facebook = new facebook($key, $secret);
$out = $this->facebook->api_client->call_method("facebook.stream.get", array('viewer_id'=>0, 'source_ids'=>$uid, 'limit'=>$limit));
then just operate with out, which contains all posts on asked page.
but, afaik, it will work only with pages, not with normal users. but dig that way to get answer.
You should make a graph call to https://graph.facebook.com/< FBID >/statuses?access_token=xxxxx
Here access_token shall have read_stream permission and offline_access permission ..
is that possible we can get the information from facebook API whether graph or REST or FQL regarding user sharing. Such as video or post or anything can share via facebook and it is shared by a list of user, with profile id or user name. I found something like this http://appshack.tv/2011/03/likes/ but it is just the counter, lack of information. Any way can do? Coz I found that facebook not stated everything in the documentation. Some trick is found from third party side.
No you can't get the user ids. Facebook will do their best NOT to share the user id with you "unless" they (the users) authorize your application.
And guess what....you can't even get the list of the users who are using YOUR application! (You can only get the count!)
Check this answer.