用于返回用户所有好友的所有相册名称和相册对象 ID 的 FQL

发布于 2024-10-15 20:13:33 字数 92 浏览 4 评论 0原文

寻找 fql 查询来获取所有朋友的所有相册,

使用 FB.Data.query 和 jQuery 的完整 js 示例加分,以便在结果出现时吐出结果。谢谢!

looking for fql query to grab all albums of all friends,

extra points for complete js example using FB.Data.query and jQuery to spit out results as they come in. thanks!!

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

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

发布评论

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

评论(1

北方的巷 2024-10-22 20:13:33

您需要 friends_photos 权限,然后使用:
Javascrip:

$("#friends-albums").click(function() {
    FB.api(
        {
            method: 'fql.query',
            query: 'SELECT aid,owner,name FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me()) LIMIT 25'
        },
        function(resp) {
            $.each(resp, function(k,v) {
                console.log(v.name)
            })
        }
    );
});

HTML:

<button id="friends-albums">Get Albums</button>

注意:

  • 我使用的是 jQuery
  • 要获取完整列表,请删除 LIMIT查询字符串
  • console.log 中的 25 是一个 firebug 命令,如果您没有 firebug,请使用 alert() 代替。

You need the friends_photos permission and then use:
Javascrip:

$("#friends-albums").click(function() {
    FB.api(
        {
            method: 'fql.query',
            query: 'SELECT aid,owner,name FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me()) LIMIT 25'
        },
        function(resp) {
            $.each(resp, function(k,v) {
                console.log(v.name)
            })
        }
    );
});

HTML:

<button id="friends-albums">Get Albums</button>

Note:

  • I'm using jQuery
  • To get the full list, remove LIMIT 25 from the query string
  • console.log is a firebug command, use alert() instead if you don't have firebug.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文