Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get most commented posts in disqus?

Tags:

php

drupal

disqus

I was looking into disqus api for most commented posts but it leads me to nowhere. Can somebody share with me how to get thread/posts ordered comment count? Something like this:

listPosts.json?orderby=comment_count&order=desc
like image 595
claire Avatar asked Feb 03 '26 12:02

claire


2 Answers

I was dealing with the same issue and the answer is on:

http://disqus.com/api/docs/threads/listPopular/

You can set these parameters...and more...

$api_key = 'your_public_key';
$interval = '90d';
$forum = 'your_website_shortname';
$limit = 5;

$url_call = "http://disqus.com/api/3.0/threads/listPopular.json?api_key=" . 
            $api_key . "&forum=" . $forum . "&interval=" . 
            $interval . "&limit=" . $limit;

$get_contents = file_get_contents( $url_call ); 

$call = json_decode($get_contents);
like image 159
jpmayoral Avatar answered Feb 05 '26 02:02

jpmayoral


The Disqus API seems not to support this directly. But threads/list has a posts element for each response.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!