Facebook FQL按名称选择相册

时间:2013-01-25 16:39:14

标签: javascript facebook coffeescript facebook-fql

是否可以通过指定其名称来获取特定相册中的用户照片?我试图只获得名为“移动上传”的专辑。

offset = 0
mobile = "mobile uploads"
mobileUploads = "SELECT src_big FROM photo WHERE album_object_id IN (SELECT aid FROM album WHERE name=" + mobile + ") ORDER BY created DESC LIMIT " + offset + ",16"
$.getJSON "https://graph.facebook.com/fql?q=" + mobileUploads.replace(/\s+/g, "+") + "&access_token=" + FB.getAccessToken(), (data) ->

1 个答案:

答案 0 :(得分:1)

是的,但是你的FQL中有一些错误。试试这个:

SELECT src_big FROM photo WHERE album_object_id IN 
   (SELECT object_id FROM album WHERE owner = me() AND name="mobile uploads") 
   ORDER BY created DESC
  • aid!= album_object_id
  • 您必须指定owner才能使子查询可转换。
  • 您还可以使用type = 'mobile',以防用户重命名其“移动上传”相册或拥有多个相册。