og:url 让我发疯了吗?

发布于 2024-12-11 02:23:56 字数 588 浏览 0 评论 0原文

希望你能帮助我...

我想要一个带有 facebook 元标签的页面,例如:

<meta property="og:title" content="TITULO" />
<meta property="og:type" content="website" />       
<meta property="og:image" content="http://profile.ak.fbcdn.net/hprofile-ak-snc4/277072_61646342824_993843268_n.jpg" />      
<meta property="og:url" content="http://www.clarin.com" />

问题是,不是显示我在页面元标签中定义的描述、标题和图像,而是生成了 facebook 之类的框使用我的 og:url 中定义的 url。我正在阅读文档,似乎应该是这样。

但我仍然希望仅使用页面的元标记生成类似 facebook 的框,而不是使用 og:url 中定义的 url。

是否可以?有人做过吗?

hope you can help me...

I want to have a page with facebook metatags, like:

<meta property="og:title" content="TITULO" />
<meta property="og:type" content="website" />       
<meta property="og:image" content="http://profile.ak.fbcdn.net/hprofile-ak-snc4/277072_61646342824_993843268_n.jpg" />      
<meta property="og:url" content="http://www.clarin.com" />

and the problem is that instead of showing the descriptions, titles and images that I define in the metatags of my page, the facebook like box is generated with the url defined in my og:url. I was reading documentation and it seems that it should be in that way.

But I still want the facebook like box generated only with the metatags of my page, and not with the url defined in og:url.

is it possible? someone has done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天暗了我发光 2024-12-18 02:23:56

og:url 基本上告诉 FB 抓取工具“忽略此页面上的任何内容,并抓取此 url”
所以它正在做它应该做的事情。如果您希望点赞按钮指向不同的 url,请使用 href 参数并使其指向不同的 url。

请参阅https://developers.facebook.com/docs/reference/plugins/like/< /a> 了解更多信息。

og:url basically tells the FB scraper "ignore anything on this page, and scrape this url instead"
So it's doing exactly what it's supposed to do. If you want the like button to point to a different url, use the href parameter and have it point to a different url.

See https://developers.facebook.com/docs/reference/plugins/like/ for more information.

哀由 2024-12-18 02:23:56

我想我明白你在问什么。就像 @Jeff Sherlock 所说的“og:url 基本上告诉我们的抓取工具“忽略此页面上的任何内容,并抓取此 url”...”

因此,如果 og:url 是当前页面以外的任何内容 - Facebook 将尝试抓取相反,从那里打开图形数据。

如果这是一个您试图将人们发送到的页面,如果他们点击发布到用户墙(已经喜欢您的页面)的“喜欢的对象” -

我为此目的制作了一个工具 - 因为我认为这可能对其他人有帮助:

Facebook/Open Graph Like 按钮生成器

它生成(并存储)开放图表标签,因此您无需将它们放入您的页面,“重定向 URL”告诉它将所有流量发送到哪里。

它也可以检测 Facebook 机器人/抓取工具,因此不会干扰任何事情 :)

祝你好运

I think I understand what you are asking. Like @Jeff Sherlock said "og:url basically tells our scraper "ignore anything on this page, and scrape this url instead"..."

So if og:url is anything other than the current page -- Facebook will try to scrape the open graph data from there instead.

If this is a page you are trying to send people to if they click on the 'like object' that is posted to a users wall (who has already liked your page) --

I made a tool for this exact purpose -- as I thought it might be helpful to others:

Facebook/Open Graph Like button Generator

It generates (and stores) the open graph tag(s) so you don't need to put them in your page at all and the 'Redirect URL' tells it where to send all the traffic.

It detects the Facebook bot/scraper too so it won't interfere with anything :)

Good luck

年少掌心 2024-12-18 02:23:56

您可以将“赞”按钮放在 iframe 中。此外,该 iframe 可能需要也可能不需要通过设置 src 属性来填充。我会尝试将like按钮代码添加为innerHTML,然后尝试使用单独的文件来设置src。

它看起来像这样:

<iframe><place like code here></iframe>

当这不起作用时,将类似的代码放在一个单独的文件中,并将 iframe 的 src 设置为该文件。如果您有疑问请告诉我

you can put the like button in an iframe. Furthermore, that iframe may or may not need to be filled by setting a src attribute. I would try adding the like button code as innerHTML, and then try a separate file to set the src to.

It would look something like this:

<iframe><place like code here></iframe>

When that doesn't work, place the like code in a separate file, and set the src of the iframe to that file. Let me know if you have quesitons

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文