I am trying to develop an application on facebook for which i need those friends with whom the user interacts the most on facebook .In short i need a list of top friends of a user. How can i do that.What parameters do i need to look for in the graph api for finding the top friends.
Facebook doesn't provide this information directly per se but it would be pretty easy to use FQL statements to generate this information yourself. Check out the FQL documentation asn you could run queries against the stream table to find user interactions. You could also look at checkin table and album/photo/photo_tag, although these would require more permissions from the user.
Related
I'm using Facebook graph Api to search users and data that i get is kinda different from that i get from Facebook UI. For example search response of User interface is friends, mutual friends and other related data in first. How can i query to get related data for current user ( i.e friends and mutual friends in first place).
Here is query that i'm using to search users.
https://graph.facebook.com/v2.5/search?fields=id,name,picture.type(normal)&limit=50&q={q}&type=user&access_token={token}
and data that i get is kinda different from that i get from Facebook UI
That’s because those are two completely different things.
The search functionality offered via the UI is called Graph Search. But the powerful possibilities that offers are not exposed via API. (To protect user privacy, and keep apps from doing extended user profiling via that data.)
Searching via API is limited to what is listed here: https://developers.facebook.com/docs/graph-api/using-graph-api/#search
That’s not much – but it’s all you get.
I'm using Facebook graph Api to search users and data that i get is kinda different from that i get from Facebook UI. For example search response of User interface is friends, mutual friends and other related data in first. How can i query to get related data for current user ( i.e friends and mutual friends in first place).
Here is query that i'm using to search users.
https://graph.facebook.com/v2.5/search?fields=id,name,picture.type(normal)&limit=50&q={q}&type=user&access_token={token}
and data that i get is kinda different from that i get from Facebook UI
That’s because those are two completely different things.
The search functionality offered via the UI is called Graph Search. But the powerful possibilities that offers are not exposed via API. (To protect user privacy, and keep apps from doing extended user profiling via that data.)
Searching via API is limited to what is listed here: https://developers.facebook.com/docs/graph-api/using-graph-api/#search
That’s not much – but it’s all you get.
I am learning facebook php and javascript sdk. I am trying to create a facebook search friend bar in my app where user types friends name and as user types, the searchbar should display most appropriate result while user is typing. Similar to what facebook search bar does. Is there a social plugin or any other tool available to acieve this task? To achieve this, I tried facebook comments plugin with user_friends permission. When user writes any friends name followed by # sign on comments field, facebook gives most appropriate result. But I dont know how to get what user wrote on comments. Any pointers will be helpful.
FB introduced API versoining. If you are going to create new app it will use version v2 and you will not get full friends list from me/friends.
/me/friends returns the user's friends who are also using your app
In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.There are two key use cases where apps need access to non-app friends: tagging and inviting. In v2.0, we've added the Taggable Friends API and the Invitable Friends API to support these flows.After a person has logged in with v2.0 of Facebook Login, calling /v1.0/me/friends and/v2.0/me/friends` will both result in the v2.0 behaviour - both calls will return the set of the person's friends who also use the app.
Read this documentation
https://developers.facebook.com/docs/apps/upgrading
Either you can create this by yourself (not too much of complex). You have access to the friendlist, so you can get all the friends with /me/friends. You can store them (their name/info) into a variable in your application and implement search. This will make your facebook api concepts better.
Or there are many friend selectors plugin/codes that you can integrate in your application. But you'll have to modify them accordingly since you dont want to show a pre-populated list of friends instead you want to implement search.
I've used mbrevoort's multi-friend selector in my applications.
But if you just want to implement search, implementing on your own would be really easy and less complicated!
As the title says i want to search with Facebook Api (Graph Api or FQL, that doesnt matter, or even REST) for users.
For example: I want to search for "Britney Spears" and i want to get all users with that name (like %search%).
The result should be like http://www.facebook.com/search/results.php?q=britney%20spears&init=quick&tas=0.8058435615324403&type=users
you can use the search API from the Graph API for a particular user like this:
People: https://graph.facebook.com/search?q=USER_NAME&type=user
If you want to search for a list of users, you can you this:
SELECT uid, username, name, pic_square FROM user WHERE contains("Joe Biden")
Refer official user table docs to see all the fields you can query
But the CONTAINS() function is known to be mysterious and no one from facebook has clarified it yet. It might work in some cases and others it might not.
see thread: Documentation for CONTAINS() in FQL?
I guess the final answer would be that you cannot replicate the facebook search functionality like the site does (searching all users of a given name). You can only search users related to the current logged in user who is using your app since these are the type of social apps that facebook wants developers to build. They want you building apps that provide value to their users by utilizing their social graph of their friends and relatives. Developers don't need site wise search for this I suppose, hence there is no API to do this (yet).
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.