In order to overcome the limitation of Facebook graph API only returning 100 user likes ("/me/likes?limit=100"), I devised a loop that continues until all likes are retrieved. This results in separate graph API response objects, which need to be merged into one after the loop completes. Below is a brief example array showcasing two Facebook responses:
var responses = [
{
"data":[
{
"category":"Community",
"name":"Uxcamp.pl",
"id":"1401334970104742",
"created_time":"2015-05-28T12:05:13+0000"
},
{
"category":"Musician/Band",
"name":"The Shins",
"id":"129599657069433",
"created_time":"2015-05-21T15:59:10+0000"
}
],
"paging":{
"cursors":{
"before":"MTQwMTMzNDk3MDEwNDc0Mg==",
"after":"MTI5NTk5NjU3MDY5NDMz"
},
"next":"https://graph.facebook.com/v2.3/999625400069239/likes?access_token=CAAKvGzm…i7RfCs4rI5yqCsUxKJA87vpgMiYo8IYku59uHt&limit=2&after=MTI5NTk5NjU3MDY5NDMz"
}
},
{
"data":[
{
"category":"Other category",
"name":"Other event",
"id":"2342340104742",
"created_time":"2015-02-28T12:05:13+0000"
},
{
"category":"Musician/Band",
"name":"Rammstein",
"id":"129543547069433",
"created_time":"2015-03-21T15:59:10+0000"
}
],
"paging":{
"cursors":{
"before":"MTQwMTMzNDk3MDEwNDc0Mg==",
"after":"MTI5NTk5NjU3MDY5NDMz"
},
"next":"https://graph.facebook.com/v2.3/34095843095874309438/likes?access_token=CAAKvGzm…i7RfCsIOSIOS(o8IYku59uHt&limit=2&after=MTI5NTk5NjU3MDY5NDMz"
}
}
];
// function...
// response = mergeAll(response);