2011-11-10 51 views
1

以獲得我想要的功能我的應用程序我需要開始使用FQL。Facebook/me/home FQL等效

因爲我用的是主流: -

$fb_news_feed = $facebook->api('/me/home'); 

這將是在FQL的equivelent返回相同的JSON。我目前的FQL低於

$fb_feed_params = array(
     'method' => 'fql.query', 
     'query' => "SELECT post_id, actor_id, target_id, message, likes, created_time, type FROM stream WHERE filter_key = 'nf' AND is_hidden = 0 LIMIT 100", 
); 

$fb_news_feed = $facebook->api($fb_feed_params); 

如何獲取用戶名等?我猜我將不得不做一些像在MySQL中一樣的連接?

回答

0

這個查詢應該這樣做 -

SELECT name, username, pic from user WHERE uid IN (SELECT actor_id FROM stream WHERE filter_key = 'nf' AND is_hidden = 0 LIMIT 100)

或者你可以看看做一個multiquery。更多關於multiqueries的信息可以在facebook開發者網站上找到:

https://developers.facebook.com/docs/reference/rest/fql.multiquery/