Facebook Comments Plugins Profile

Source: Internet
Author: User
Tags comments requires urlencode in domain to domain

First, you need to create an app on Facebook and create a way to see Https://developers.facebook.com/,APP there is an entry in domain that fills in your website domain. (app is bound to domain and cannot be filled in)

Then you can use Facebook comments plugins.

Using Facebook comments Plugins, you can insert Facebook comments on the page.

Generate Code Method: Https://developers.facebook.com/docs/plugins/comments

For example, there is a http://www.example.com/page where you can use comments Plugings to insert the following code into this page.

<!--include Facebook JS SDK-->
<script id= "Facebook-jssdk src="//connect.facebook.net/en_gb/all.js# xfbml=1&appid= here fill in appId "></script>  
       
<!--comments Plugins-->
<fb:comments Colorscheme= "Light" numposts= "4" height= "360px", "width=" 614px "href=" http://www.example.com/"fb-xfbml-state=" Rendered "class=" Fb_iframe_widget "></fb:comments>

appear on the page as follows

Total number of pages shared and comments read

Https://graph.facebook.com/?ids={your_url}

{Your_url} requires UrlEncode

For example: Https://graph.facebook.com/?ids=http%3A%2F%2Fwww.example.com%2F

Return:

{  
   "http://www.example.com/": {"  
      id": "http://www.example.com/",  
      "shares": 399517,  
      "comments": 392  
   }  
}

The code is as follows:

<?php  
$url = ' http://www.example.com/';  
$api = ' https://graph.facebook.com/?ids= ';  
       
$result = Json_decode (file_get_contents ($api. UrlEncode ($url)), true);  
       
Print_r ($result);  
? >

Read Page Comments List

Https://graph.facebook.com/comments/?ids={your_url}

{Your_url} requires UrlEncode

For example: Https://graph.facebook.com/comments/?ids=http%3A%2F%2Fwww.example.com%2F

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.