Search code examples
javascriptphphtmlhtml-parsinglivefyre

How to get comment count on livefyre?


I would like to get the comment count in my own database so that I can then sort my articles by comment count.

Every time a page is read on my site, I'd like to ask Livefyre how many comments that certain page has, then update the database with that count.

I tried to get the source of the page but it doesn't seem to be helpful.

Any suggestions?


Solution

  • Atish's answer is correct as the best way for the JavaScript on the page to be notified of the Comment Count so that you can track via client-side analytics or update another place on the page where the count is rendered.

    From the server side, you can use the 'init' request for any Conversation to retrieve the public comment count.

    Finally, you can use the Livefyre Activity Stream API to get a real-time firehose of your community activity, which you can use to keep a count up to date on your end.