// Basic public profile info. No extra permissions needed.
FB.api('me', function(response) {
....
}
// Profile picture. No extra permissions needed
FB.api('me/picture', function(response) {
....
}
// OR just get the user id and place id here.
<img src="http://graph.facebook.com//picture" />
// Get friends with friend lists. Requires read_friendlists permission
FB.api('me?fields=friendlists.fields(name,members)', function(response) {
....
}
// Get friends' location with lat long. This is an example on how to use FQL to get complex data.
FB.api(
{
method: 'fql.multiquery',
queries: {
'query1' : 'SELECT uid, name, pic_square, current_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())',
'query2' : 'SELECT page_id, name, latitude, longitude FROM place WHERE page_id IN (SELECT current_location FROM #query1)'
}
},
function(response) {
...
}
);
// Get friend's post on my wall.
FB.api(
{
method: 'fql.query',
query: 'SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id = me() AND actor_id != me() LIMIT 100;'
},
function(response) {
...
}
);
// Get friend's post on my wall.
FB.api(
{
method: 'fql.multiquery',
queries: {
'query1': 'SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id = me() AND actor_id != me() LIMIT 100;',
'query2' : 'select name, current_location from user where uid IN (select actor_id from #query1)'}
},
function(response) {
...
}
);