简体   繁体   English

如何在网站上添加喜欢的Facebook帖子

[英]How to add facebook post like to website

I want to add facebook post like when user clicks on it. 我想添加Facebook帖子,例如当用户单击它时。

Example: 例:

this is my facebook post link. 这是我的Facebook帖子链接。

https://www.facebook.com/permalink.php?story_fbid=115308402188346&id=100011275598659 https://www.facebook.com/permalink.php?story_fbid=115308402188346&id=100011275598659

<div class="my-post"><a href="link">Like My Post</div>

I want this to open in dialog box and want to record callback weather user like it or not. 我想在对话框中打开它,并希望记录是否喜欢回调天气用户。

how can i do that? 我怎样才能做到这一点?

This is what you need: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.5 这就是您需要的: https : //developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.5

Use the edge.create event to listen for likes. 使用edge.create事件收听喜欢。 This only works for external websites with the Like Button plugin , of course you can´t listen for likes on facebook.com and the plugin only works for external links or Facebook Pages (NOT posts on those). 这仅适用于带有Like Button插件的外部网站,当然,您不能在facebook.com上收听喜欢,并且该插件仅适用于外部链接或Facebook页面(在这些页面上没有帖子)。

"Posting a Like" is not possible with just a link, especially if there is no user authorization. 仅通过链接就无法“发布喜欢”,尤其是在没有用户授权的情况下。 The only "like" that is possible with the API is og.likes , it´s explained in the docs: https://developers.facebook.com/docs/opengraph/guides/og.likes API唯一可能的“ og.likes ”是og.likes ,它在文档中进行了解释: https : //developers.facebook.com/docs/opengraph/guides/og.likes

That´s only possible for your own Open Graph Objects though. 不过,这仅适用于您自己的Open Graph对象。 What you want to achieve is not possible at all (in a legal way). 您要实现的目标根本不可能(以合法方式)。

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

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