How to get comments from comments on a social plugin?

I tried with the api chart, which asked a lot of questions, but none of them returns comments. I want to get all comments and place a separate page for search and indexing of search engines. comments are very rich and I want them

+4
source share
4 answers

You can return comments (actually messages and their comments) from the comments plugin from this api url: https://graph.facebook.com/comments/?ids= {$ url_of_your_page}

+3
source

see documentation here: http://developers.facebook.com/docs/reference/fql/

the table you should request is here:

http://developers.facebook.com/docs/reference/fql/comment/

(this is also one of the first examples)

the key is that you can specify an identifier for each comment plugin you add. using this identifier, you can select comments using the api chart.

with respect to search engines, you should not give the impression that you are using different content for spiders than for users, so it would probably be nice to load comments by default api (please cache them), and then replace it with javascript, if javascript is available, so users can post new comments.

even better (in my opinion) will always display comments in html on your site and only load the facebook comment plugin if the user wants to make a new comment. but this probably requires another step for the user.

you can also read ajax chrawling diagram

+1
source

If you want to use the graphical API, what you are doing is capturing the comment identifier in json (the very first number you see and it looks like {user_id} _ {status_message_ID} example: 1234_5678910) and then https: // graph .facebook.com / {the number you received}? access_token = {access token}

Eliminate what you could do is run the system that you do to post all status messages and comments on your website (for example, “for everyone” or “while” instructions, etc.), then add an “if” statement that if the count (according to json comments) is more than 3, it will retrieve json for this record using the identifier and spit out your data.

Hope this helps. Please tell me if you want everything explained further.

Hello,

John

+1
source

You can use this url to get URL comments and paginate them:

? fields = og_object {comments.order (reverse_chronological) .limit (10) .after (NgZDZD)} & id = {YOUR_URL}

Even it works with the latest version (v2.10).

0
source

Source: https://habr.com/ru/post/1334375/


All Articles