2

I am trying to get the comment count from disqus. Now To count comments, I just use javascript provided by Disqus like this

 function () {
            var s = document.createElement('script');
            s.async = true;
            s.type = 'text/javascript';
            s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
        }()

Btw, I look into them which are not updated right now. So I want to solve this problem how to update the number of comments in real-time. Do you have any idea for this? Please let me know.

Thanks

supersam654
  • 3,126
  • 33
  • 34
Soo
  • 387
  • 2
  • 10
  • 19

1 Answers1

0

To load disqus comments count dynamically add the following code to your template:

DISQUSWIDGETS.getCount({reset: true});

One common use case of this function is to update elements on the page that were not available via the initial load of count.js.

Djalel
  • 1
  • 2