Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcramer/475750 to your computer and use it in GitHub Desktop.
Save dcramer/475750 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Comments count code example</title>
</head>
<body>
<!-- For this link, we will try to fetch comments count by URL: http://example.com/article.html -->
<a href="http://example.com/article.html#disqus_thread">First article</a>
<!-- For this link, we will try to fetch comments count by identifier: article2identifier -->
<a href="http://example.com/article2.html#disqus_thread"
data-disqus-identifier="article2identifier">Second article</a>
<!-- We will ignore this link because its href attribute does not end on #disqus_thread -->
<a href="http://example.com/" data-disqus-identifier="tenthousands">Anchor</a>
<script type="text/javascript">
// This is actual code that needs to be inserted.
var disqus_shortname = 'websiteshortname'; // Put your website's shortname here
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://disqus.com/forums/' + disqus_shortname + '/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment