I’m working on a project with facebook connect in node.js.
Everything is working great but now I want to get a list of friends from facebook for the connected user, I have the access token from the user
but i don’t know how to start getting the data from facebook
Any help?
Working with facebook API from node.js is very easy, create a module (for example:
facebook.js)facebook.jsNow, in your code import your facebook module (
var facebook = require('./facebook.js');) and use it like here:The
getFbData()is a generic function, you can call it with your api request path (say ‘/me/friends’), pass theaccess tokenof the current user and a callback function to be called when the data is ready.