FQL用于返回用户的所有朋友的所有相册名称和对象ID的相册 [英] FQL for returning all album names and object id's of the albums for ALL friends of a user
本文介绍了FQL用于返回用户的所有朋友的所有相册名称和对象ID的相册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
寻找fql查询以获取所有朋友的所有相册,
looking for fql query to grab all albums of all friends,
使用FB.Data.query和jQuery的完整js示例的额外点可以吐出结果,因为他们进入。谢谢!!
extra points for complete js example using FB.Data.query and jQuery to spit out results as they come in. thanks!!
推荐答案
您需要 friends_photos
然后使用:
Javascrip:
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:
HTML:
<button id="friends-albums">Get Albums</button>
注意:
- 我使用jQuery
- 要获取完整列表,请从查询字符串 $中删除
-
console.log
是一个firebug命令,使用alert()
而不是有firebug。
LIMIT 25
b $ b - I'm using jQuery
- To get the full list, remove
LIMIT 25
from the query string console.log
is a firebug command, usealert()
instead if you don't have firebug.
这篇关于FQL用于返回用户的所有朋友的所有相册名称和对象ID的相册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文