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

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

问题描述

我有一个Facebook,链接到一个女巫页面,我没有完全控制:我可以修改< body> 而不是< head> 的页面...
所以我试图将类似按钮的链接设置在我完全控制的新页面上,设置opengraph元标签在此页面上,并设置一个链接到原始页面的og:url。



但是最终Facebook尝试从og:url中提取元数据,并覆盖元标记的前一页...
有可能告诉我要从第一个抓取的URL中删除元数据,而不是从og:url?

解决方案

没有办法指示linter从页面中提取OpenGraph元数据,该页面的URL不同于 og:url 中定义的URL。 p>

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



有一种方法来做别的事情(w您可以或可能不符合您的需求:



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



小心,这将把所有喜欢的内容都关联到最终页面,而不是中间的。


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.

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 ?

解决方案

There is no way to instruct linter to extract OpenGraph metadata from page which have URL different than one defined in og: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):

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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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