admin管理员组文章数量:1335098
I bed through the Facebook documentation but didn't see an obvious way to return ONLY photos on a user's newsfeed. Specifically:
Give a FB access token, I want to get the newsfeed filtered to only photos that were posted.
=
Returns the entire newsfeed. I see that elements have a "Type" attribute, that has a value of "photo" when it's a photo.
How can I scope the response to only return photos?
I bed through the Facebook documentation but didn't see an obvious way to return ONLY photos on a user's newsfeed. Specifically:
Give a FB access token, I want to get the newsfeed filtered to only photos that were posted.
https://graph.facebook./me/home?access_token=
Returns the entire newsfeed. I see that elements have a "Type" attribute, that has a value of "photo" when it's a photo.
How can I scope the response to only return photos?
Share Improve this question asked Dec 17, 2011 at 5:35 TMCTMC 8,15412 gold badges55 silver badges74 bronze badges2 Answers
Reset to default 5Sure, you can do this using FQL:
SELECT
post_id, message, attachment
FROM
stream
WHERE
filter_key
IN (
SELECT
filter_key
FROM
stream_filter
WHERE
uid = me()
AND
name = "Photos"
)
Working demo using Graph API Explorer:
https://developers.facebook./tools/explorer?method=GET&path=fql%3Fq%3DSELECT%20post_id%2C%20message%2C%20attachment%20FROM%20stream%20WHERE%20filter_key%20IN%20(SELECT%20filter_key%20FROM%20stream_filter%20WHERE%20uid%3Dme()%20AND%20name%3D%22Photos%22)
EDIT:
Looks like that link won't work. This is the request to the graph api. You need read_stream
permissions.
https://graph.facebook./fql?q=SELECT post_id, message, attachment FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid=me() AND name="Photos")
Facebook has added a filter parameter to the /me/home endpoint
so if you query /me/home?filter=photos
you get only photos from the users News Feed
本文标签: javascriptHow to get only photos from user39s Facebook newsfeed using graph apiStack Overflow
版权声明:本文标题:javascript - How to get only photos from user's Facebook newsfeed using graph api? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742384573a2464769.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论