2

我是 Facebook 开发的新手,我正在玩一些概念证明。我将如何编写查询以获取喜欢 U2 页面的所有朋友的列表?

我在想这样的事情。

var result = fb.Get("fql", new { q = "SELECT name FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me()) AND 'U2' IN like" });

也签到

var result = fb.Get("fql", new { q = "SELECT checkin_id, author_uid, page_id FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND page_id IN (SELECT page_id FROM page WHERE name = '我的地方')” });

还有查询生成器工具吗?

4

1 回答 1

4

应该这样做(例如使用 PHP SDK (v3.x) )

$page_id = ID OF PAGE

$result = $facebook->api(array(
    'method' => 'fql.multiquery',
    'queries' => array(
        'friends_liking_page' => 'SELECT uid, page_id FROM page_fan WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND page_id = ' . $page_id,
        'result' => 'SELECT uid, name, pic FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me() AND (uid2 IN (SELECT uid FROM #friends_liking_page)))'
    )
));

你需要user_likesfriends_likes许可

于 2012-05-25T22:21:27.263 回答