Javascript 如何将 Facebook 页面的评论嵌入我的网站
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28618692/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to embed a Facebook page's reviews into my website
提问by jumpingjay
I am trying to figure out how to have the Facebook reviews listed for my company embedded into a page on my website. Here is the link for my Facebook reviews: https://www.facebook.com/jump2itpartyrentals/reviews?ref=page_internal. I thought that since this feed was available to the public, I could get around having to obtain a Token to access it, but I haven't had any luck with it.
我想弄清楚如何将我公司列出的 Facebook 评论嵌入到我网站上的页面中。这是我的 Facebook 评论的链接:https: //www.facebook.com/jump2itpartyrentals/reviews?ref=page_internal。我认为由于此提要对公众可用,因此我可以避免必须获得令牌才能访问它,但我对此没有任何运气。
Any help sure would be appreciated. Thanks!
任何帮助肯定会受到赞赏。谢谢!
回答by luschn
Since there is no Social Plugin for this, and since scraping is not allowed on Facebook, you MUST use the Graph API for showing the Ratings/Reviews on your external Website. The docs offer everything you need to know, including some example code: https://developers.facebook.com/docs/graph-api/reference/v2.2/page/ratings
由于没有用于此的社交插件,并且由于 Facebook 不允许抓取,因此您必须使用 Graph API 在您的外部网站上显示评级/评论。文档提供了您需要知道的一切,包括一些示例代码:https: //developers.facebook.com/docs/graph-api/reference/v2.2/page/ratings
You have to use a Page Token. I suggest using an extended one, since it is valid forever. Here's more about Access Tokens, if you don't know how they work:
您必须使用页面令牌。我建议使用扩展的,因为它永远有效。如果您不知道它们是如何工作的,这里有更多关于访问令牌的信息:
- https://developers.facebook.com/docs/facebook-login/access-tokens
- http://www.devils-heaven.com/facebook-access-tokens/
- https://developers.facebook.com/docs/facebook-login/access-tokens
- http://www.devils-heaven.com/facebook-access-tokens/
Scraping terms: https://www.facebook.com/apps/site_scraping_tos_terms.php
抓取条款:https: //www.facebook.com/apps/site_scraping_tos_terms.php
回答by NotDragon
try taking a look at this page in facebook's developers section. it has a bunch of api's for you to use. https://developers.facebook.com/docs/plugins/commentsThis is a comments bar that will display all comments of your wanted url.
尝试在 facebook 的开发人员部分查看此页面。它有一堆 api 供您使用。https://developers.facebook.com/docs/plugins/comments这是一个评论栏,将显示您想要的 url 的所有评论。

