是否可以从获取的 url 而不是规范 url 中提取元数据? [英] Is it possible to extract metadata from fetched url instead of canonical url?

查看:30
本文介绍了是否可以从获取的 url 而不是规范 url 中提取元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似 Facebook 的链接,指向我无法完全控制的女巫页面:我可以修改 <body> 但不能修改 <head>...所以我尝试在一个我可以完全控制的新页面上设置like按钮的链接,在这个页面上设置opengraph元标记,并设置一个链接到原始页面的og:url.

I have a Facebook like that links to a page on witch I don't have complete control: I can modify the <body> but not the <head> of the page... So I tried to set the link of the like button on a new page on which I have complete control, set the opengraph metatags on this page, and set an og:url that links to the original page.

但最终 Facebook 会尝试从 og:url 中提取元数据并覆盖上一页的元标记...是否可以告诉我想从第一个获取的 url 中而不是从 og:url 中抓取元数据?

But in the end Facebook tries to extract metadata from the og:url and overrides the metatags of the previous page... Is it possible to tell that I want to scrape metadata from the first fetched url and not from the og:url ?

推荐答案

无法指示 linter 从具有不同于 og:url 中定义的 URL 的页面中提取 OpenGraph 元数据.

There is no way to instruct linter to extract OpenGraph metadata from page which have URL different than one defined in og:url.

Linter 将始终从链末尾的 og:url 中定义的 URL 中提取元标记...

Linter will always extract the meta tags from URL defined in og:url at the end of the chain...

有一种方法可以做其他事情(可能会,也可能不会满足您的需求):

There is a way to do something other (which may, or may not fit your needs):

您可以创建中间页面,其中包含所有必需的 OpenGraph,包括指向该页面的 og:url(不是您无法控制的页面).该页面将只有元数据和 JavaScript/Meta 重定向到最终页面,因此登陆此中间页面的用户将被重定向到正确的最终页面.

You can create intermediate page that will have all the required OpenGraph including og:url pointing to that page (not the one you have no control over it). That page will only have meta-data and JavaScript/Meta redirect to the final page, so user who land this intermediate page will be redirected to the correct final page.

请注意,这会将所有赞关联到最终"页面而不是中间页面.

Beware, this will associate all the likes not to the "final" page but to the intermediate one.

这篇关于是否可以从获取的 url 而不是规范 url 中提取元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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