I want to get facebook friends Id of a specific facebook user. how can i do this?
in detail : I have a server, and form a mobile I'll send a facebook id of a user to that server. accoding to that facebook id I want to get facebook ids of friends of that user. (this should do from server) please any one guide me to do that.
answer = for this we should have access token.
Sounds like facebook wouldn't like that :)
You could scan profile.php?id=&sk=friends and parse the output for the ids.
But I'm sure the habe some fancy Ajax running giving you an easier method.
Have you checked their API? https://developers.facebook.com/docs/reference/api/FriendList/
But you need permissions for that.
Related
I need to be able to consolidate all the likes from users that use my Facebook app into an Excel or .csv file. I can have the user authenticate within my Facebook app, but is there a way to see the likes for all users of an app using Open Graph or some other Facebook tool? I'm certain that someone else must have had this problem, and I'm hoping that one of you can help me out!
I've been trying to run FQL queries to bring up likes, but don't have any experience with PHP so it has been miserable so far. Any ideas?
There's no way to retrieve a list of users of your app - you'll need to manually build that as users authorise the app see this question for more information
Assuming you have permission to access a user's likes connection - access /USER_ID/likes and parse the response, saving it to a file in accordance with whatever language you're using's syntax (google is your friend here)
Note that your use of the data is subject to Facebook's policies and user's consent in accordance with your privacy policy and sharing it with third parties may be illegal (i am not a lawyer, this is not official advice, etc etc)
Here is the problem with that the application type does not have a like connection. Application Object GraphAPI This is inconvenient when you are looking to gather data on the users that like it.
OR were you talking about the likes endpoint of the user object? That you can gather but I dont think it is what you are looking for. It is shown here Graph Explorer Example - user's likes
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!
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!
I'm looking for a way to get a users facebook profile id or username which i can use to get the profile picture based on the users account. I know how to fetch the picture already (http://graph.facebook.com/username_or_id/picture). I don't want to ask the user to submit their fb username (or worse - their profile id), i need it all done automatically (happy user).
Now i have not setup a Facebook app to use the facebook SDK so i don't have a appID or a secret code...
The reason for not setting it up is because im working on something that not only i will use. It's a project where others will be able to use on their own domain and i don't want to ask the users to setup their own FB app just to get this working so im looking for a way to do it, without the FB SDK? or have i got it all wrong?
You can do everything without FB SDK (it's just a library), but you can do nothing without application. So no, you can't get user's ID without their knowledge
I'm used to working with Twitter, where friend/follower totals are available in a simple XML request.
My goal is a simple "enter your username/user id, and display your friends count".
Is there something like this for Facebook? From what I gather, I'll have to make an application, and have anyone who wants to grab their friends total actually install that app from within their own Facebook profile.
Anyone have any experience with this?
You can get friend count by fql easily.
There is a friend_count field against the user table that you can query.
SELECT friend_count FROM user WHERE uid = me();
https://graph.facebook.com/fql?q=SELECT friend_count FROM user WHERE uid={any id}
You do need to set up an application, but it'll work as a Connect app - meaning that users won't have to access it through their Facebook profile at all. In broad terms you'll need to:
Set up an application
Implement Facebook Connect on
your site
Get users of your site to log in
with Connect. (You can't ask for
their username/password.)
Make a Friends.get call to the
API, probably with the JavaScript
client library (although there
are server-side ways you can do it)
Facebook provides an API for developers so you can grab information from Facebook. Check it out at the provided link.
Edit: From your tags, it looks like you are already familiar with the Facebook API. You can use the API with external applications or webpages - it doesn't necessarily need to be used within a Facebook app, if that is what you are asking.