如何使用 facebook API 获取公共墙贴 [英] How to get public wall posts with the facebook API

查看:24
本文介绍了如何使用 facebook API 获取公共墙贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从个人主页 facebook 获取墙贴.我的粉丝页面没有问题,我的用户令牌是有效的(至少对于粉丝页面).

I m trying to get wall posts from a profile facebook. I have no problems with the fan pages and my user token is valid (at least for the fan pages).

此帖子的示例:https://www.facebook.com/aurelia.filion/posts/10151342315613445如您所见,该帖子是公开的.

Example with this post : https://www.facebook.com/aurelia.filion/posts/10151342315613445 As you can see the post is public.

所以我尝试:graph.facebook.com/529628444_10151342315613445?access_token=MY_TOKENgraph.facebook.com/10151342315613445?access_token=MY_TOKEN

So i try: graph.facebook.com/529628444_10151342315613445?access_token=MY_TOKEN graph.facebook.com/10151342315613445?access_token=MY_TOKEN

它返回:错误": {"message": "不支持的获取请求.","type": "GraphMethodException",代码":100

it returns : "error": { "message": "Unsupported get request.", "type": "GraphMethodException", "code": 100

在我的 Api 图形浏览器中,我也看不到该用户的帖子.graph.facebook.com/529628444?fields=posts(529628444 是 aurelia.filion 的 id)

In my Api graph explorer, i can't see the posts from this user neither. graph.facebook.com/529628444?fields=posts (529628444 is the aurelia.filion's id)

那么有可能拿到墙贴吗?它是公开的,应该是一种获取它们的方式

So is it possible to get the wall posts? It's public it should be a way to get them

谢谢

好的,我会以不同的方式解释,我的目标是通过图表获得此类帖子(我可以获得除论文之外的所有其他帖子)

ok i 'll explain in a different way, my goal is to get this kind of posts with the graph (i can get all others posts except theses)

facebook.com/aurelia.filion/posts/10151342315613445

facebook.com/aurelia.filion/posts/10151342315613445

facebook.com/aurelia.filion/posts/10151336175793445

facebook.com/aurelia.filion/posts/10151336175793445

但我收到错误不支持的获取请求."

but i get the error "Unsupported get request."

我已经尝试过用户令牌和应用令牌此链接不起作用:graph.facebook.com/529628444_10151342315613445?access_token=MY_TOKEN

i've tried both user token and app token this link doesnt work : graph.facebook.com/529628444_10151342315613445?access_token=MY_TOKEN

当我尝试使用提要时,我看不到我想要的帖子.

when i m trying with the feed i dont see the posts i want in there.

如果我请求帖子 graph.facebook.com/529628444/posts?limit=100&access_token=TOKEN我可以看到除了该死的帖子之外的所有内容(链接、照片等)!!

And if i request the posts graph.facebook.com/529628444/posts?limit=100&access_token=TOKEN i can see everything (link, photo etc) except the freaking posts!!

我怎样才能得到这些帖子,它是不是令牌问题,它看起来像是一种状态,获取是否不同,我的意思是我们需要权限吗?graph.facebook.com/529628444?fields=statuses&access_token=TOKEN 它不返回任何结果!它是空的!

How can i get theses posts, is it a token problem, it looks like it's a status, is it different to get, i mean do we need permissions? graph.facebook.com/529628444?fields=statuses&access_token=TOKEN it doesnt return any results! its empty!

编辑

推荐答案

EDIT

这个答案是在 Graph API 版本的第一个版本时写回的.那时您可以使用用户 ID 获取用户提要,现在用户 ID 不再在应用程序之间共享.facebook 还创建了一个新 API,仅对部分合作伙伴开放.

EDIT

This answer was written back when the Graph API version was in its first version. Back then you could get the user feed by using the user ID, right now the user ID is no longer shared between apps. Also facebook created a new API that it's only available to some of it's partners.

因此,除非用户使用过您的应用,否则您目前无法获取公共用户提要.不过,您仍然可以获得 Pages 提要.

So right now it's impossible for you to get the public user feed, unless the user has used your app. You can still get the Pages feed though.

此答案适用于图形 api v1

This answer was for graph api v1

所以你必须使用这个https://graph.facebook.com/529628444?fields=feed&access_token=YOUR_TOKEN

如果你只想查询公共数据,你可以通过这样做来创建一个 APP 令牌:

And if all you want is query public data you can create a APP Token by doing this:

https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials 

并使用此令牌而不是您的用户令牌.

And use this token instead of using your user token.

这篇关于如何使用 facebook API 获取公共墙贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆