【问题标题】:FQL for returning all album names and object id's of the albums for ALL friends of a user用于返回用户所有朋友的所有专辑名称和专辑对象 ID 的 FQL
【发布时间】:2011-02-06 05:03:14
【问题描述】:

寻找fql查询来抓取所有朋友的所有专辑,

完整的 js 示例使用 FB.Data.query 和 jQuery 在输入结果时吐出结果。谢谢!!

【问题讨论】:

    标签: jquery facebook facebook-fql


    【解决方案1】:

    您需要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 25
    • console.log 是一个 firebug 命令,如果您没有 firebug,请改用 alert()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-16
      • 1970-01-01
      相关资源
      最近更新 更多