Linter 给出“解析 URL 时出错”错误

发布于 2024-12-21 17:57:10 字数 741 浏览 2 评论 0原文

目标: 我正在尝试在我的博客上应用“赞”按钮 - 这是我第一次尝试。

行为: 该按钮会显示,但当有人单击“喜欢”时,“喜欢”按钮旁边会显示红色的“错误”一词。不会与 Facebook 进行任何交互。

修复尝试: 我已经尝试过 iframe 和 html5 实现,使用这两种方法的行为相同。

修复尝试#2: “错误”一词显示为超链接,建议我使用 Facebook Linter,所以我就这样做了。但是,当我输入 URL 时,Linter 给出了以下错误:

解析 URL 时出错:解析输入 URL 时出错,未抓取任何数据。

我尝试过我的博客主 URL (douganddaniele.tumblr.com) 和单个帖子的 URL (http://douganddaniele.tumblr.com/post/14308744801/settle-in)。

我在这里使用 Linter:https://developers.facebook.com/tools/debug

请求帮助: 显然,这里有些东西是我误解的。有人可以帮忙吗?

GOAL:
I'm trying to apply a Like button to my blog - this is my first time trying it.

BEHAVIOR:
The button shows up, but when someone clicks "Like", the word "error" shows up in red next to the like button. No interaction with Facebook occurs.

FIX TRIED:
I've tried both the iframe and the html5 implementation, same behavior using both methods.

FIX TRIED #2:
The word "error" shows up as a hyperlink suggesting I use the Facebook Linter, so I did. However, when I put in my URL, the Linter gives this error:

Error Parsing URL: Error parsing input URL, no data was scraped.

I've tried my blogs main URL (douganddaniele.tumblr.com) and the URL of an individual post (http://douganddaniele.tumblr.com/post/14308744801/settling-in).

I'm using the Linter here: https://developers.facebook.com/tools/debug

PLEA FOR HELP:
Clearly there is something here that I'm misunderstanding. Can someone help?

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

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

发布评论

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

评论(10

十雾 2024-12-28 17:57:10

如果 FB 在解析任何 og 标签时出现问题,您将会收到此消息。您通常可以按照以下步骤找到问题:

1) 首先要检查,仔细检查并确保没有任何明显的问题。通常,如果您使用 WordPress 之类的东西,简单的事情可能会变得复杂。查看源代码并确保一切都如您所想。

2) 访问任意 URL。链接到不正确的 og:url 或 og:image URL 可能会导致此错误。

3) 您的 og:image URL 应为 https(截至 2011 年 10 月 1 日)。如果不是,您将收到此错误(在撰写本文时,此类事情可能会发生变化)。

如果您按照这些步骤操作后仍然遇到问题,请返回基础知识。删除所有标签并单独添加每个标签,每次都运行调试器。至少这样你就能知道哪个标签引起了头痛。

You'll get this if FB has issues parsing any of the og tags. You can usually find the issue by following these steps:

1) First thing to check, go through and make sure there isn't anything obvious. Often if you're using something like WordPress simple things can get complicated. View the source and make sure everything is as you think it should be.

2) Visit any URLs. Linking to incorrect og:url or og:image URLs can cause this error.

3) Your og:image URL should be https (as of Oct 1st, 2011). You will get this error if it is not (at time of writing, this sort of thing can change).

If you follow these steps and still have issues then go back to basics. Remove all tags and add each one individually, running the debugger every time. At least that way you'll learn which tag is causing a headache.

孤檠 2024-12-28 17:57:10

似乎在很多情况下,开发人员都会遇到以下消息:

Error Parsing URL   Error parsing input URL, no data was scraped.

并且他们无法解决此问题。我认为解决这个问题的最好方法是让 Facebook 提供更详细的错误消息。请访问他们的错误跟踪器并发表评论、订阅或添加到重现计数器。

It seems there are many cases where developers are encountering the message:

Error Parsing URL   Error parsing input URL, no data was scraped.

and they are unable to solve this. I think the best way to tackle this problem is to get Facebook to provide more detailed error messages. Please go to their bug tracker and comment, subscribe, or add to the repro counter.

夏至、离别 2024-12-28 17:57:10

我有同样的问题,但它一直存在。 。事实证明,og:image 标签中损坏的 jpg 导致了错误。我将图像重新保存为 png,它又开始工作了。

I had the same issue but it was constant. . .turns out a corrupted jpg in the og:image tag caused the error. I re-saved the image as a png and it started working again.

地狱即天堂 2024-12-28 17:57:10

当我的 .htaccesses 文件没有时,我会收到此错误,

RewriteCond %{HTTP_REFERER} !^$

有时我不添加此行以防止直接链接图像和内容。如果我把它取下来,调试工具就会正常。

I get this error when my .htaccesses files haven't

RewriteCond %{HTTP_REFERER} !^$

sometimes i dont add this line in order to prevent direct linking of images and stuff. if i take it off, the debug tool goes ok.

狂之美人 2024-12-28 17:57:10

请等待并重试。几分钟后为我工作。

Just wait and try again. Worked for me, after a couple of minutes.

独自唱情﹋歌 2024-12-28 17:57:10

还要检查您是否没有 php 重定向(www.site.com 到 site.com),这也给了我很多开放图错误。所以我决定删除它。

Also check if you don't have e.g. a php redirect (www.site.com to site.com), that gave me lots of open graph errors, too. So I decided to remove it.

故人的歌 2024-12-28 17:57:10

我发现,如果“og:image:secure_url”以外的任何“og:”元标记包含 https:// 链接,Facebook 就会给我出现此错误。

最好的调试过程似乎是从页面中删除所有元标记,然后将它们一一添加回来,并修复任何导致 linter 中断的问题。

I found that Facebook gave me this error if any of my "og:" meta tags other than "og:image:secure_url" contained an https:// link.

The best debug procedure seems to be to remove all meta tags from your page, then add them back one by one, and fix any that cause the linter to break.

×眷恋的温暖 2024-12-28 17:57:10

当我的页面的 HTML 包含一个 IMG 标记,该标记指向 Facebook 的 linter 无法到达的服务器(公司防火墙)时,我收到此错误。

换句话说...

这有效,

<html>
  <head></head>
  <body>
    Hello World
  </body>
</html>

这不起作用

<html>
  <head></head>
  <body>
    Hello World
    <br><img src="http://server.facebook.cannot.reach.com/some/file.jpg">
  </body>
</html>

当我删除 IMG 标签或将其更改为指向公共服务器时,调试器工具起作用了。

我联系了几个在 Facebook 工作的朋友,请他们向负责调试器工具的人员求助,以提供更具描述性的错误消息。

I got this error when the HTML of my page included an IMG tag that pointed to a server that Facebook's linter couldn't reach (corporate firewall).

In other words...

THIS WORKS

<html>
  <head></head>
  <body>
    Hello World
  </body>
</html>

THIS DOES NOT WORK

<html>
  <head></head>
  <body>
    Hello World
    <br><img src="http://server.facebook.cannot.reach.com/some/file.jpg">
  </body>
</html>

When I removed the IMG tag or changed it to point to a public server, the debugger tool worked.

I contacted a couple friends who work at Facebook and asked them to lean on the folks in charge of the Debugger tool to provide more descriptive error messages.

沫离伤花 2024-12-28 17:57:10

我遇到了同样的问题,我在调试器中使用的 URL 有这样的问题:

www.mysite.com?s=&blah=yes

Facebook 不喜欢 s 查询字符串没有值。

I had the same problem where my URL I was using in the debugger had this:

www.mysite.com?s=&blah=yes

Facebook didn't like the s query string not having a value.

你不是我要的菜∠ 2024-12-28 17:57:10

你是不是设置了错误的链接?

CASE 1: // OK
<meta property="og:image" content="http://exsample.com/test.jpg" />

CASE 2: // Error parsing input URL, no data was scraped.(No Image Mime)
<meta property="og:image" content="http://exsample.com/" />

Aren't you setting incorrect link?

CASE 1: // OK
<meta property="og:image" content="http://exsample.com/test.jpg" />

CASE 2: // Error parsing input URL, no data was scraped.(No Image Mime)
<meta property="og:image" content="http://exsample.com/" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文