Django project idea: Disqus application
13 May 2008
Filed under Django, Internet, Programming
I’m putting this out there because I can see there’s a need for it. Disqus, which I mentioned in my previous post, has a couple of methods of integration.
The method I chose, the quick and dirty route, is to insert a chunk of JavaScript in certain places on your blog that injects comment counts, a comment thread, and a comment box into your page.
On the other side, is a great potential for true integration with your custom blog or site. Disqus has a fairly full featured API:
All API methods accept their parameters in the query string of a GET request. All requests MUST end with a trailing slash (before the query string). Requests are currently throttled per IP address. In the event that you are throttled, the data is retrieved from a cache of the previous request. Slug parameters are human-readable unique identifiers (usually a string shortword for describing an object, such as a thread’s title).
It is conceivable that an individual could construct a model or two that contains all of the information returns by Disqus’ API.
One hang up
The only issue I can see is trigging the importing of new comments. The comment form will likely have to be either constructed in a similar manner as the form injected via iframe when you slap the JavaScript bit into your site, or mimicked somehow. The submission of the comment (to Disqus’ server) would, ideally, trigger a refresh of the comments via the API.
The first problem is how you throw a local trigger on a submission to a site you don’t control. The second problem is the delay you’ll no doubt encounter in bringing that comment into your local system.
As it stands, most users expect their comment to show up once the page reloads, and it doesn’t seem entirely possible with the current API (or perhaps the documentation is out of date?). I would love if someone more familiar with Disqus or a developer could fill in any gaps I might’ve missed!

