向非 Facebook 用户显示 Facebook 帖子

Displaying Facebook posts to non-Facebook users(向非 Facebook 用户显示 Facebook 帖子)
本文介绍了向非 Facebook 用户显示 Facebook 帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

有没有一种方法可以在不要求用户登录的情况下将 Facebook 内容(特别是来自公共页面的墙贴)显示在网站上?在离线访问权限被弃用之前,我会简单地创建一个令牌作为我自己,存储它,并根据需要提取信息.

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 文档,到期时间每天只能延长一次

推荐答案

假设您拥有该页面,您可以使用 manage_pages 权限.manage_pages 权限是我可以收集的永久令牌.然后在graph api上使用/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 帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)