September 2016
Beginner to intermediate
531 pages
12h 55m
English
Before we go about retrieving data we should probably decide what data we wish to visualize. The amount of data which is available about the logged in user is not all that great (at least it isn't for me but I hardly use Facebook). That leaves us with looking at our friends. I found devices my friends use to access Facebook to be quite interesting. Are they more Android users or iOS? This information is available as part of the friends' collection. To retrieve this information we can use the FB.api() method:
FB.api('/me?fields=friends.fields(devices)', function(response){ for(i = 0; len = response.friends.data.length; i< len; i++){ var friend = response.friends.data[i]; if(friend.devices) for(j = 0; j< friend.devices.length; j++) ...Read now
Unlock full access