简体   繁体   English

如何在私有站点上集成Facebook Comments插件?

[英]How to integrate Facebook Comments plugin on a private site?

I've successfully integrated the comments plugin on a site that requires our own custom login. 我已经成功将注释插件集成到需要我们自定义登录的网站上。 However, when the user leaves a comment with the option "Post to Facebook" checked, the update on the user's news feed displays "Object moved" as the title of the page instead of the actual title. 但是,当用户留下评论并选中“发布到Facebook”选项时,用户新闻源上的更新将“对象移动”显示为页面标题,而不是实际标题。

Is there a way to specify the title in a metatag or an attribute or some other way that doesn't require the plugin to access the page directly? 有没有一种方法可以在metatag或属性中指定标题,或者不需要插件直接访问页面的其他方法?

No, there really isn't a way to do that. 不,确实没有办法。 The opengraph tags SHOULD do this, but as far as I can tell Facebook always hits the link in the comment. opengraph标签应该做到这一点,但据我所知,Facebook总是会点击评论中的链接。 One thing you may want to do is look out for Facebook's crawler User-Agent string and return an abbreviated form of the page content (but this may run afoul of their rules, so I'm not sure you want to do that without some thought about Facebook's possible reaction). 您可能想做的一件事是寻找Facebook的抓取工具User-Agent字符串并返回页面内容的缩写形式(但这可能违反其规则,因此我不确定您是否想这样做而已)关于Facebook可能的反应)。

You can use the Facebook URL Linter (at http://developers.facebook.com/tools/lint ) to see what's happening when they try and reach out to your page. 您可以使用Facebook URL Linter(位于http://developers.facebook.com/tools/lint )来查看他们尝试访问您的页面时发生的情况。

如果您使用的是Open Graph,则该页面需要公开访问-或-您可以将Facebook用户代理列入白名单以进行访问facebookexternalhit/1.1

Actually it's facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php) . 实际上是facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)

See http://www.quora.com/What-is-the-user-agent-string-for-the-Facebook-like-share-crawler . 参见http://www.quora.com/What-is-the-user-agent-string-for-the-Facebook-like-share-crawler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM