是否有 API 可以强制 Facebook 再次抓取页面? [英] Is there an API to force Facebook to scrape a page again?

查看:20
本文介绍了是否有 API 可以强制 Facebook 再次抓取页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道您可以通过在 Facebook 的调试器工具上输入 URL 来强制更新页面的缓存,同时以该应用/页面的管理员身份登录:https://developers.facebook.com/tools/debug

I'm aware you can force update a page's cache by entering the URL on Facebook's debugger tool while been logged in as admin for that app/page: https://developers.facebook.com/tools/debug

但我需要的是一种方法来自动调用 API 端点或从我们的内部应用程序中调用任何东西,只要我们的销售部门的人更新我们的一个页面的主图像.要求数以千计的销售人员以管理员身份登录并在他们更新我们的商品描述或图片时手动更新页面缓存不是一种选择.

But what I need is a way to automatically call an API endpoint or something from our internal app whenever somebody from our Sales department updates the main image of one of our pages. It is not an option to ask thousands of sales people to login as an admin and manually update a page's cache whenever they update one of our item's description or image.

我们不能等待 24 小时让 Facebook 更新其缓存,因为我们每天都会收到客户的投诉,只要他们在我们这边更改后没有立即看到更改.

We can't afford to wait 24 hours for Facebook to update its cache because we're getting daily complaints from our clients whenever they don't see a change showing up as soon as we change it on our side.

推荐答案

页面元数据不是那种应该经常更改的东西,但是您可以通过转到 Facebook 的调试工具 并输入您要抓取的网址

Page metadata isn't the sort of thing that should change very often, but you can manually clear the cache by going to Facebook's Debug Tool and entering the URL you want to scrape

还有一个用于执行此操作的 API,它适用于任何 OG 对象:

There's also an API for doing this, which works for any OG object:

curl -X POST 
     -F "id={object-url OR object-id}" 
     -F "scrape=true" 
     -F "access_token={your access token}" 
     "https://graph.facebook.com"

现在需要一个 access_token.这可以是应用程序或页面 access_token;无需用户身份验证.

An access_token is now required. This can be an app or page access_token; no user authentication is required.

这篇关于是否有 API 可以强制 Facebook 再次抓取页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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