Created
April 29, 2014 22:00
-
-
Save castroalves/347a8cc3674e5f8d0de6 to your computer and use it in GitHub Desktop.
FQL - Get User's First Liked Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getUserFirstPageLiked: function() { | |
var query = { | |
'query1': 'SELECT page_id FROM page_fan WHERE uid = me() ORDER BY created_time ASC LIMIT 1', | |
'query2': 'SELECT page_id, name, page_url FROM page WHERE page_id IN ( SELECT page_id FROM #query1 )' | |
}; | |
FB.api('/fql', { q: query }, function( response ) { | |
if( response && !response.error ) { | |
$('#page-like').text( response.data[1].fql_result_set[0].name ); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment