0

让 Timeline 正常工作时遇到问题。这是一个两部分的问题。

首先,存在缓存部分 OG 元标记的问题。当调试器转到我的 URL 时,我知道它正确地命中了它,因为它吐回的 og:url 是正确的,这意味着它已经在我端进行了处理(例如:我将它发送到 og.php?og=read&chapter=799 ,它会为 og:url 返回正确的 book_id,这意味着我的脚本处理了它)。但是所有其他信息似乎都被缓存了。我最初错误地有一个对象的 fb:app_id 和 og:site_url,所以我删除了它们。输出仍然显示那些存在抛出错误的现有 site_url。拥有 fb:app_id 会强制 og:type 的“网站”,我已经(正确地)将其设置为我的命名空间和对象。当我尝试发布操作时,我收到一个 oAuthException 错误,即“网站”的 og:type 对对象无效。再次,这应该是固定的,但它会一直缓存旧的 OG 数据。我尝试添加 ?fbrefresh=1,但没有任何效果。

另一个问题,可能相关......即使我知道它已经到达那里,并且我的脚本处理了请求,但 Facebook 没有报告这一点。当我点击“查看我们的抓取工具对您的 URL 看到的确切内容”时,它会显示身份验证 URL(见下文)!好像它从来没有到达那里并且弹出窗口已经启动,这甚至不是 og.php 的代码的工作方式!我的猜测是,在尝试使用 example.com/og.php 的完整请求之前,他们是从基本域名本身 (exmaple.com) 获得的。

window.parent.location='https://www.facebook.com/dialog/oauth?client_id=164431733642252&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fexample%2F%3Fpage%3D&state=064bd26ff582a9ec7c96729e6b69bbd2&canvas=1&fbconnect=0&scope =电子邮件%2Cpublish_stream%2Cpublish_actions%2C';

4

2 回答 2

0

I'm having similar problems to you. It kept complaining about og:site_url being set, even though I never set those. It appears that the error messages it sends are actually inaccurate, and the problem is not that og:site_url is being set, but that the og:url is different from the object url. Sometimes a wrong error message is worse than no error message!

A further question is why an object url has to correspond to a live page that a user will see. An object is a logical unit, but it doesn't necessarily correspond to a single user-visible page. Your redirection trick might work, but it is not the proper way to do something. When I post an action related to an obect, the object url should be used to draw the information of the object, but I should be able to send the user somewhere else. If this was an intended design I think it is a mistake.

于 2011-12-22T05:24:06.187 回答
0

我想到了。我认为 og:url 是您希望人们用来访问应用程序中正确页面的 URL,例如操作链接。是,但不是。我现在让它与您发送到时间线的 OBJECT_URL 匹配。

我有一个不同的 URL(应用程序的操作链接),当重定向时,爬虫无法访问它,因为它位于应用程序授权墙内。这导致网站的 og:type 和数据出现缓存。

为了修复它,我发布到时间轴的 object_url 和元标记中的 og:url 是相同的。但是您可以通过查找查询字符串来确定它是爬虫还是操作链接:?fb_action_ids=SOME_ID,它是从时间轴上的链接发送的。如果它包含它,那么我将它转发到从那里需要的应用程序页面。

于 2011-12-19T23:54:19.920 回答