GET calls to the url http://www.facebook.com/ajax/typeahead_friends.php?u=${USER ID}&__a=1 (replace ${USER ID}) seem to get the friends list of that user. Is there an ``official'' way of doing this, i.e. through the documented facebook APIs?
A more "offical" way is to use the Graph api.
Related
I am using PHP to work on Facebook, and I want to get an access_token to get User Data Permission for items like
email
user_actions.music
user_activities
user_events
user_location
etc.
I know this can be done by using Graph API Explorer in Facebook developers. Can you show me how to do this in PHP? Thanks!
After include'ing the Facebook SDK for PHP, simply call $facebook->getLoginUrl with appropriate parameters.
i'm looking for a way to code some statistics for a facebook group which displays infos like most active member, most commented post and such.
i've tried to parse the group's email-notifications, unfortunately facebook doesn't notify on each event.
so i was thinking about curling directly from the facebook group.
is there a way to do this or is it possible through the facebook api?
thanks
I think your best bet is Facebook Grap API.
Check this Graph API - Group : http://developers.facebook.com/docs/reference/api/group/
Hope this help!
I need to grab the statuses from a Facebook page via PHP to display on the page. I don't want to have people logging in to facebook just for my script to grab the statuses from the page since it is a public page and isn't restricted. I have the Facebook API for PHP in my projects directory but have no idea how to use it to do what I want it to. Could someone give me a code example of how I'd do this? Thanks!
It's really a straight forward task if you follow the documentation. Since /PAGE_ID/feed requires any valid access_token, your app access_token is enough to get the data:
Open the Graph API Explorer (I'm querying coca-cola/feed)
Get an app access_token from the Access Token Tool and use it instead of yours
You're done!
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.
Im kind of new in facebook development, so be patient with me :)
I'm creating an app that manage the photo albums user. One of the features i'm developing needs to access the friends photos. I mean, the photos that my app user can see of his friends. How can retrieve thats albums and photos information? I have user_photos and friends_photos permission.
Any sugestion?
Thanks in advance!!
Sorry for my lame english. Is not my native language.
Sebastian
You need to make an API call, for this you can use Facebook Graph API.
Look at the following API for albums
http://developers.facebook.com/docs/reference/api/album/
This is for generic purpose, however you need to first pull all the friends from here
http://developers.facebook.com/docs/reference/api/FriendList/
To fetch the albums of a friend you also need to set permissions
http://developers.facebook.com/docs/reference/api/permissions/
check:friends_photos
You can simply fetch the album like this
https://graph.facebook.com/{userId}/albums?accessToken=something
PS. you need to pull albums of friends one by one.
References to get you started
Start with the Graph API:
developers.facebook.com/docs/reference/api/
Read up on a few more things:
http://developers.facebook.com/docs/opengraph/
http://developers.facebook.com/docs/
Use Graph explorer to test things out:
http://developers.facebook.com/tools/explorer/
Your fist app
Now in order to do anything on facebook you need to create an application. You will get an app token when you do this. Something like: 288229791195831
Your users need to Like your application in order to use it. Then you can use it to post photos, wall messages etc.
This is the URL your application could use to log in a user:
https://graph.facebook.com/oauth/authorize?client_id=288229791195831&redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent&display=popup&scope=publish_stream,user_photos,read_stream,email
Replace your client_id with the app id you get from facebook. Scope shows the permissions this app is requesting.
Good luck!