nerkn
nerkn

Reputation: 1982

How to get comments from comments social plugin?

I tried with graph api asked many things to there but none of them are returns comments. I want to get all comments, and put in a separate page for search engines to scan and index. comments are very rich full and I want them

Upvotes: 4

Views: 3387

Answers (4)

RockOnGom
RockOnGom

Reputation: 3951

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

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

Even It works with latest(v2.10) graph version.

Upvotes: 0

gorodezkiy
gorodezkiy

Reputation: 3419

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

Upvotes: 3

BetaPAWDkitsune
BetaPAWDkitsune

Reputation: 199

If you want to use the graph API what you do is grab the comment ID in the json (the very first number you see and it appears as {user_id}_{status_message_ID} example: 1234_5678910) and then have https://graph.facebook.com/{the number you got}?access_token={access token}

Do reduce strain what you could do is run the system that you do to put all the status messages and comments onto your website (for instance a 'for each' or 'while' statements etc) then add an 'if' statement that says if count (under comments on the json) is more than 3 it'll retrieve the json for that post using the id and spit out your data.

I hope this was of some help. Please say if you want anything explained further.

Regards,

Jon

Upvotes: 1

The Surrican
The Surrican

Reputation: 29856

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

the table you need to query is this here:

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

(it is also one of the first examples)

the key is that you can specify an identifier for every comment plugin that you embed. using this identifier you can then select comments using the graph api.

regarding search engines you should not make the impression that you are serving different content to the spiders than to the users so it would probably be a good idea to load the comments over the api by default (please cache them) and then replace it by the javascript box if javascript is available, so the users can write new comments.

even better (in my opinion) would be always to display the comments in html in your website and only load the facebook comments plugin if the user wants to make a new comment. but that probably requires one additional step for the user.

you can also read about the ajax chrawling scheme

Upvotes: 1

Related Questions