Search Facebook Friends by name using Graph API - php

I know how to search name in our MySQL Database using %search%. But using Graph API, how can we search user's facebook friends by name? I am using taggable_friends to get list of all user's friends. Is there a way to call Facebook Graph's API using %search% and get the result JSON with matching friend's names?

You can use the Search API to search for users by name:
https://developers.facebook.com/docs/graph-api/using-graph-api#search

Related

get recent tweets from twitter using API 1.1

I want to get recent tweets from twitter using API 1.1 .
I just don't want to get it only for current user or user's followers. I want to get all the tweets from all the users.
Is there a way by which I can get all user's tweets.
Is there any limit for this type of API call?
I want to fetch all the tweets at the application level, that means I won't be having any user token. How I can do this?
EDIT:
I found that we can use SEARCH API to search recent tweets using this
https://dev.twitter.com/docs/api/1.1/get/search/tweets
But In this API we have to pass the q parameter to search. But what if I don't want search based on specific parameter. I just want all the tweets from last 24 hours.
Is there way where I don't have to pass q in search API?
You want to call
https://stream.twitter.com/1.1/statuses/sample.json
This will allow you to get a random sample of the most recent tweets made by all users.
I am pretty sure there isn't any way to get all the tweets from all users at an application level. What you want to do is have your application store a version of each users tweet in a DB and then query the DB for that information. This approach also doesn't come with any call limits.
You look at a list of the available Twitter API v1.1 calls available in its REST API at:
https://dev.twitter.com/docs/api/1.1
The only application level call is:
GET application/rate_limit_status

Facebook get user about page information using graph api

Is there any way to get information in user About page using graph API?
For instance, we can get the user Work and education by going here
http://www.facebook.com/van.trankhanh.1/about
But there is no information about Work and education if we use this
https://graph.facebook.com/van.trankhanh.1?access_token=AAAEaY81Vw24BAB96Yf2VNWMm8GdjMctjxGQj3ycrtoi7RhMn4SCOOVGcgtaZCuyHbP3nNyKulleaQ440IvQKHWlub2TZC6TrIWrLGIYgZDZD

PHP Facebook API: How to retrieve how long I've been friends with someone

I'm curious if it's possible to get the "friendship" information via the Facebook PHP API, meaning information about the friendship the logged in user and one of his friends share?
Information that is visible on this page:
https://www.facebook.com/profile.php?id=[YOUR ID]&and=[YOUR FRIENDS' ID]
Is this possible?
Via the Graph API you can query the /me object. Two properties you will want relationship_status and significant_other. I don't see where it specifies the "how long" part. Not from the Graph API nor from FQL.
Also see me/family in the graph.

Search users on the basis of name and location Facebook Graph API, FQL

Here's what I am trying to achieve, I have a facebook application which makes use of the search api
example - https://graph.facebook.com/search?q=mark&type=user
using that I am able to search for users with either their email or name or location, what I also want to do is search on combination of name and location, I also tried fql but that is also not providing the desired result.
Is there a way using FAcebook API to search for people using more than one criteria
You can try this
$user_friends1 = file_get_contents('https://graph.facebook.com/'.$uid.'/friends?fields=id,name,birthday&access_token='.$access_token);
$user_friends = json_decode($user_friends1,1);
now you can find what you want from $user_friends array

Fetching Facebook "likes" data from a user's profile using old rest api

Is it possible to fetch the "likes" data from a user's profile using the old rest api ? Specifically FB has launched this new "Likes" feature recently, where a user can Like a page, etc. This information is visible under the "interests and likes" section of the Info page of a user. I am looking for a way to fetch this information using the old rest api. Is there a field in user.getInfo that I can query on that will return this information ?
Short Answer: No
Long Answer: Nooooooooooooooooooooo
Getting a users likes is not possible using the old REST API. You can continue making all your existing API calls using the old API, and just use the graph for likes.
I'd recommend using the Graph API to do this: http://developers.facebook.com/docs/reference/api/user -- basically fetching /me/likes. It's much more natural than our older API. If you need advanced use, then you can query the page_fan FQL table: http://developers.facebook.com/docs/reference/fql/page_fan.

Categories