Facebook comments plugins introduction, facebookcomments
Introduction to facebook comments plugins
First, you need to create an APP on facebook. For details about how to create an APP, see https://developers.facebook.com/. one of the apps is to fill in the domains. Here, enter the domains of your website. (The APP is bound to a domain and cannot be filled out)
Then you can use facebook comments plugins.
Using facebook comments plugins, you can insert facebook comments into the page.
Code Generation Method: https://developers.facebook.com/docs/plugins/comments
For example, if a page is a http://www.example.com/, you can use comments plugings by inserting the following code in the page.
<! -- Include facebook js sdk --> <script id = "facebook-jssdk" src = "// connect.facebook.net/en_gb/all.js?xfbml=1&appid=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>
The following figure is displayed on the page:
Total number of shares and comments read from the page
https://graph.facebook.com/?ids={YOUR_URL}
Urlencode required for {YOUR_URL}
Example: https://graph.facebook.com /? Ids = http % 3A % 2F % 2Fwww.example.com % 2F
Return Value:
{ "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 Comments List
https://graph.facebook.com/comments/?ids={YOUR_URL}
Urlencode required for {YOUR_URL}
Example: https://graph.facebook.com/comments? Ids = http % 3A % 2F % 2Fwww.example.com % 2F
Return Value:
{ "http://www.example.com/": { "comments": { "data": [ { "id": "395320319544_27462154", "from": { "id": "100000223906701", "name": "Thu\u1eadn Phan Thanh" }, "message": "hello moto", "can_remove": false, "created_time": "2013-10-07T10:01:40+0000", "like_count": 1, "user_likes": false }, { "id": "395320319544_27877980", "from": { "id": "100001638736612", "name": "L\u00e3 Minh" }, "message": "hi you", "can_remove": false, "created_time": "2013-11-13T02:57:01+0000", "like_count": 4, "user_likes": false }, { "id": "395320319544_27879381", "from": { "id": "100004229015145", "name": "Th\u00f9y Dung" }, "message": "Mg \u1ee7ng h\u1ed9 t\u1edb v\u1edbi nh\u1edb \u003C3", "can_remove": false, "created_time": "2013-11-13T05:38:12+0000", "like_count": 3, "user_likes": false }... ], "paging": { "cursors": { "after": "MjU0", "before": "Mzk4" }, "next": "https://graph.facebook.com/v1.0/395320319544/comments?limit=25&after=MjU0" } } }}
You can request the next page based on the next url.
The Code is as follows:
<?php$url = 'http://www.example.com/';$api = 'https://graph.facebook.com/comments/?ids=';$result = json_decode(file_get_contents($api.urlencode($url)), true);print_r($result);?>
I have the following code. How can I obtain the URL of this page through documentlocationhref? How can I pass the src href In the iframe below?
Name For iframe
Then document. getElementById ("iframe name"). href = "the location you get is added with the next large slide parameter ";
You can...
Will different browsers affect wp? Facebook plug-in wordpress !!
Some topics may be poorly compatible and may be distorted in Some browsers. You can see some topics that will be compatible.