var fbid = your_fbuid_here;
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time ASC LIMIT 1'
}, function (threadresponse) {
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id = ' + threadresponse[0].thread_id + ' ORDER BY created_time ASC'
}, function (inboxresponse) {
//do stuff here with results
});
});
facebookfacebook-fqlfacebook-apifacebook-graph-apifacebook-fql-query
fonte
2012-02-18 01:36:25
prima query selezionare solo le discussioni creati con l'utente uid amico. Se il thread è stato creato dall'utente corrente, non ci saranno risultati. – vian
hey, mi stavo chiedendo se c'è un nuovo modo migliore per questo? Questo restituisce solo i messaggi creati dall'amico. – Michelle