flapane
flapane

Reputation: 543

Disqus API: get total forum number of comments/posts

I'm trying to get the total number of comments that have been written in a given forum.

Looking at http://disqus.com/api/docs/ I can't see anything like this. Honestly, it sounds weird. Forum details ( http://disqus.com/api/docs/forums/details/ ) shows anything but.

Any hack/piece of code/hidden API call that would to the trick? Thanks in advance

Upvotes: 2

Views: 1273

Answers (1)

sarfata
sarfata

Reputation: 4675

The best way I have found is to get the list of all the threads and then sum the number of posts for each one:

curl -0 -L "https://disqus.com/api/3.0/forums/listThreads.json?api_key=YOUR_API_KEY&forum=YOUR_FORUM_NAME&limit=100"

Dont forget to iterate over different pages of results if you get a 'next' cursor (response['cursor']['next']).

See this gist for a full JavaScript example (intended to run on Google Script): https://gist.github.com/sarfata/5068200

Upvotes: 3

Related Questions