简体   繁体   中英

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.

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?

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. 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).

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.

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

Actually it's 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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