FQL 朋友组

发布于 2024-12-28 11:31:05 字数 172 浏览 2 评论 0原文

我发现我可以通过 Graph API 访问朋友的群组:

https://graph.facebook.com/11111111/groups

...但是如何通过 FQL 访问它? (在问这些问题之前,我正在广泛搜索文档,如果我问的是一个显而易见的问题,抱歉)。

I see that I can access a friend's groups via the Graph API:

https://graph.facebook.com/11111111/groups

... but how do I access it via FQL? (I am searching the documentation extensively before asking these questions, sorry if I'm asking an obvious one).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云归处 2025-01-04 11:31:06

如果您想获取 id 为 1111111 的用户组,

您可以编写以下查询:

select gid, name from group 
      where gid in (select gid from group_member where uid = 1111111)

不要忘记您需要拥有 Friends_groups 权限才能获取此数据,

可以在此处找到这些表的文档:

http://developers.facebook.com/docs/reference/fql/group_member/

http://developers.facebook.com/docs/reference/fql/group/

if you want to get the groups of user with the id 1111111

you can write this query:

select gid, name from group 
      where gid in (select gid from group_member where uid = 1111111)

don't forget you need to have the friends_groups permission in order to get this data

the documentation for those tables can be found here:

http://developers.facebook.com/docs/reference/fql/group_member/

http://developers.facebook.com/docs/reference/fql/group/

不打扰别人 2025-01-04 11:31:06

是的。我尝试过它不适用于 FQL 。但您可以使用以下代码通过 graph api 获取它

function get_groups($facebook)
    {
        require_once 'config.php';
         global $facebook; 
         $groups = $facebook->api('/me/groups');
        var_dump($groups);
        return $groups;
    }

。配置文件具有以下内容:

<?php
    require_once("facebook.php");

    $app_id = "";//put the app id 
    $app_secret = "";//put app secret code inside " "

    $facebook = new Facebook(array(
        'appId' => $app_id,
        'secret' => $app_secret,
        'cookie' => true
    ));

    if(is_null($facebook->getUser()))
    {
        header("Location:{$facebook->getLoginUrl(array('req_perms' => 'user_status,publish_stream,user_photos'))}");//include the permission you want here
        exit;
    }
?>

Yeah. I tried it did not work with FQL . But you can use the following code to get it via graph api

function get_groups($facebook)
    {
        require_once 'config.php';
         global $facebook; 
         $groups = $facebook->api('/me/groups');
        var_dump($groups);
        return $groups;
    }

The config file has the following :

<?php
    require_once("facebook.php");

    $app_id = "";//put the app id 
    $app_secret = "";//put app secret code inside " "

    $facebook = new Facebook(array(
        'appId' => $app_id,
        'secret' => $app_secret,
        'cookie' => true
    ));

    if(is_null($facebook->getUser()))
    {
        header("Location:{$facebook->getLoginUrl(array('req_perms' => 'user_status,publish_stream,user_photos'))}");//include the permission you want here
        exit;
    }
?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文