如何获取非朋友的公开照片

时间:2013-08-10 15:22:02

标签: facebook-graph-api facebook-fql facebook-php-sdk

我正在尝试获取用户的公开照片(朋友的朋友)。当我浏览Facebook时,我看到它们,但我无法通过API访问它们。

SELECT created, link, caption, images, like_info FROM photo WHERE owner IN (SELECT uid FROM user WHERE username = "...") OR object_id IN (SELECT uid FROM user WHERE username = "kaja.szuminska") OR object_id IN (SELECT object_id FROM photo_tag WHERE subject IN (SELECT uid FROM user WHERE username = "...")) ORDER BY like_info DESC LIMIT 0, 100

,也不

.../albums

,也不

.../photos

,也不

.../photos/uploaded

作品。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

要访问照片(公共或非公开),您需要获得许可。因此,只能访问您的照片(使用user_photos权限)或朋友的照片(使用friends_photos权限)。

如果要抓取公开照片,只能通过查看用户的公共Feed来执行此操作。即对https://graph.facebook.com/{user_id}/feed进行API调用,然后过滤条目以查看是否发布了任何照片。