向非Facebook用户显示Facebook信息 [英] Displaying Facebook posts to non-Facebook users

查看:137
本文介绍了向非Facebook用户显示Facebook信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将Facebook内容(特别是公开页面上的墙贴)显示在没有Facebook需要用户登录的网站上?在不再使用offline_access权限之前,我将简单地创建一个令牌,存储它,并根据需要提取信息。

Is there a way to pull Facebook content (specifically wall posts from a public page) to display on a website without Facebook requiring a user login? Before the offline_access permission was deprecated, I would simply create a token as myself, store it, and pull the information as needed.

现在,从我可以看出,我唯一的两个选择是1)每60天手动更新该标记,或2)只显示内容到Facebook用户使他们允许该应用程序。显然#1不是首选,#2看起来不是很好的做法。

Now, from what I can figure out, the only two options I have are to 1) manually update that token every 60 days, or 2) display the content only to Facebook users AND make them "allow" the app. Obviously #1 is not a preferred option, and #2 doesn't seem like very good practice.

为了参考,我只是试图从公开访问的页面墙拉取内容,不需要代表用户采取任何行动(没有墙贴,没有阅读流,等等)。

For reference, I'm only trying to pull content from a publically accessible page wall and require no action on behalf of the user (no wall posting, no reading stream, etc).

这似乎是一个非常简单的概念,我觉得我必须缺少一些东西。我在任何地方找不到答案。这些真的是我唯一的两个选择吗?任何反馈将非常感激。

This seems like a really simple concept, and I feel like I have to be missing something. I can't find an answer anywhere. Are these really my only two options? Any feedback would be much appreciate.

更新:

我想我可能已经找到了一个办法。随着offline_access被弃用,有一个fb_exchange_token选项可用于扩展现有令牌的到期。调用以下内容:

I think I may have found a way around this. With offline_access being deprecated, there is an fb_exchange_token option available to extend the expiration of an existing token. With a call to the following:

https://graph.facebook.com/oauth/access_token?client_id={app_id}&client_secret=
{app_secret}&grant_type=fb_exchange_token&fb_exchange_token={existing_token}

您应该收到一个扩展到期的令牌。在我的情况下,我将允许应用程序通过我自己的Facebook帐户,将令牌存储在我的PHP代码中,只需使用cURL定期更新现有代码。

you should receive a token with an extended expiration. In my scenario, I will allow the app through my own Facebook account, store the token in my PHP code, and just use cURL to periodically update the existing code.

<注意:根据Facebook文档,过期日期只能延长一次

Note: According to the Facebook documentation, the expiration can only be extended once per day

推荐答案

假设你拥有您可以使用manage_pages权限的页面。 manage_pages权限是我可以收集的永久性标记。然后使用/ feed与相关的页码相关的页码来拉取信息。

Assuming you own the page you can use the manage_pages permission. The manage_pages permission is a permanent token from what I can gather. Then use /feed on the graph api with the relevant page number to pull the information.

我假设你拥有这个页面。如果您没有或未明确授予许可,则您无权将此信息撤回。

I am assuming you own this page. If you don't or aren't explicitly given permission then you don't have the rights to pull this information down.

这篇关于向非Facebook用户显示Facebook信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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