views:

382

answers:

5

Does anyone know how disqus works?

It manages comments on a blog, but the comments are all held on third-party site. Seems like a neat use of cross-site communication.

A: 

short answer? AJAX, you get your own url eg "site.com/?comments=ID" included via javascript... but with real time updates like that you would need a polling server.

John
Yes. But how does posting work? Is it wrapping an iframe (FB-connect style)?
Toby Hede
+1  A: 

You have three options when adding Disqus commenting to a site:

The main advantage of the integrated solutions is that they're easy to set up. In the case of WordPress, for example, it's as easy as activating a plug-in.

Having the ability to communicate with the API directly is very useful, and offers two advantages over the other options. First, it gives you as the developer complete control over the markup. Secondly, you're able to process comments server-side, which may be preferable.

davidchambers
I was looking at more of a technical insight into how they do what they do, for a project with some similar requirements.
Toby Hede
+2  A: 

The general pattern used is JSONP

Its actually implemented in a fairly sophisticated way (at least on the jQuery site) ... they defer the loading of the disqus.js and thread.js files until the user scrolls to the comment section.

The thread.js file contains json content for the comments, which are rendered into the page after its loaded.

Sam Saffron
A: 

I think they keep the content on their site and your site will only send & receive the data to/from disqus. Now I wonder what happens if you decide that you want to bring your commenting in house without losing all existing comments!. How easy would you get to your data I wonder? They claim that the data belongs to you, but they have the control over it, and there is not much explanation on their site about this.

VN44CA
One more thing I add: If you use their APIs to fetch the comments and then display it, then you can make it SEO friendly as the search engines are able to pick that up. If you let their JS to pull the comments onto your pages, then that might not be SEO friendly as search bots usually can't candle AJAX calls. (according to Google's techie girl on youtube). The advantage of using AJAX is that your backend will not care about the performance of Disqus, and your pages load up pretty fast.
VN44CA
A: 

I go for disqus than my own comment module.

Disqus is awesome. Wonderful thing about disqus is the flexibility in customization. Have a look at this site. You will never realize, it is disqus except the logo.

Siva