Facebook Group Feed PHP SDK [英] Facebook Group Feed PHP SDK

查看:120
本文介绍了Facebook Group Feed PHP SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我在这里完全感到困惑.

Okay, I'm getting completely confused here.

facebook API令我感到困惑,我一无所获,我不断看到术语像用户身份验证令牌"那样乱七八糟,但是我对如何前进一无所知即将获得所有这些设置并可以正常工作,因此,我们不但可以粘贴链接作为答案,还可以得到一些解释,请获取几乎是教程式的答复.

The facebook API has baffled me and I've not got a single clue what I'm doing, I keep seeing terminology getting slung around like "user your auth token" and such, However I'm clueless on how I go about to get all this setup and working, so without just getting a link pasted as an answer could we get some explanations, almost tutorial-esque responses please.

情况如下:

具有cron作业设置的Dev网络服务器可将每天的帖子从一个私人群组下载到数据库(一旦获得提要,就可以执行此操作).

Dev webserver with a cron job setup to download each days posts from a private group to a database (can do this once I've got the feed).

我们所拥有的.

  • 1个私人组(非所有者)的管理员帐户
  • 该管理员帐户上的1个应用程序设置为facebook-仅在已输入必填字段的位置,所以我们有一个应用程序ID和应用程序密钥.

但是,每当我尝试通过graph.facebook.com访问提要时,我要么只能获得该组的ID,要么oAuth会失败.

However, whenever I try gain access to the feed via graph.facebook.com I either get only the ID of the group, or oAuth failed.

我想要的数据是 https://graph.facebook.com/473828522631951 ?字段=进料&安培; =的access_token CAAAAAITEghMBAPeTF7ENB5H6yUGS6Jzj8azTzJAe9CwOrjAsaZCTziFklDvnkO4AKRAbZCXlBIZCK58ZCR7JlLaNVYx2rcgvNJIRzqjr6RLZBZBaG0W6Dq88DfjvIxFy3Ctg4JZB7rRNOc58BjNmPaGFYzplW7DOMzSXtJKXL2j2QZDZD这里(但是我复制来自Facebook页面dev的此链接,所以我想访问令牌将在短期内到期)

The data I want is https://graph.facebook.com/473828522631951?fields=feed&access_token=CAAAAAITEghMBAPeTF7ENB5H6yUGS6Jzj8azTzJAe9CwOrjAsaZCTziFklDvnkO4AKRAbZCXlBIZCK58ZCR7JlLaNVYx2rcgvNJIRzqjr6RLZBZBaG0W6Dq88DfjvIxFy3Ctg4JZB7rRNOc58BjNmPaGFYzplW7DOMzSXtJKXL2j2QZDZD here (however I copied this link from facebook dev page, so I guess the access token will shortly expire)

这基本上是我想要的结果,但是我无法弄清楚如何正确设置应用程序/获得访问应用程序供稿或其他任何内容的权限.

This is basically the result I want, however I cant figure out how to setup the app correctly/gain permissions to access the apps feed, or anything.

请有人阐明如何通过PHP SDK,CURL或file_get_contents或其他方式准确获取私有Facebook组的Feed.

Could somebody please shed some light on how to exactly get the Feed of a private facebook group, via either the PHP SDK, CURL or file_get_contents or however.

非常感谢

推荐答案

由于您的论坛是私有论坛,因此只有属于该论坛的用户才能看到该供稿.这意味着您将需要一个用户访问令牌.您要访问的网址是 https://graph.facebook.com/473828522631951/feed/?access_token=yourtoken

Since your group is private only users belonging to that group can see the feed. That means you will need a user access token. The url you want to access is https://graph.facebook.com/473828522631951/feed/?access_token=yourtoken

您可以按照 https://developers.facebook中的说明来扩展令牌. com/docs/facebook-login/access-tokens/

找到标题为过期和扩展令牌"的部分.这些令牌持续60天. 我通过构建一个管理页面(每60天定期登录一次)来解决django/python中的类似问题.登录成功后,它将用户访问令牌写入配置文件(我使用config.yaml).我的应用程序读取配置文件中的令牌,并使用它通过Facebook Graph API访问组的数据. 在令牌过期之前,您可以让您的应用通过电子邮件发送给网站管理员,告诉他们 再次登录以在配置文件中重写令牌. https://developers.facebook.com/docs/reference/php/ https://developers.facebook.com/docs/reference/api/group/ https://developers.facebook.com/docs/reference/dialogs/oauth/

Find the section titled "Expiration and Extending Tokens". These tokens last for 60 days. I resolved a similar problem in django/python by constructing an admin page in which I login periodically through facebook (every 60 days). Upon login success, it will write the user access token into a configuration file (I use config.yaml). My app reads the token in the config file and uses it to access the group's data through the Facebook Graph API. Before the token expires, you can have your app email the site admins telling them to login again to rewrite the token in the configuration file.https://developers.facebook.com/docs/reference/php/ https://developers.facebook.com/docs/reference/api/group/ https://developers.facebook.com/docs/reference/dialogs/oauth/

这篇关于Facebook Group Feed PHP SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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