-
Notifications
You must be signed in to change notification settings - Fork 0
/
foot.html
31 lines (28 loc) · 976 Bytes
/
foot.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{% include analytics.html %}
{% if site.disqus %}
<script id="dsq-count-scr" src="//jalpc.disqus.com/count.js" async></script>
<script type="text/javascript">
var disqusShortName = "{{ site.disqus.name }}";
var disqusPublicKey = "{{ site.disqus.public_key }}";
var urlArray = [];
$('.disqus-comment-count').each(function () {
var url = $(this).attr('data-disqus-url');
urlArray.push('link:' + url);
});
$.ajax({
type: 'GET',
url: "https://disqus.com/api/3.0/threads/set.jsonp",
data: { api_key: disqusPublicKey, forum : disqusShortName, thread : urlArray },
cache: false,
dataType: "jsonp",
success: function (result) {
for (var i in result.response) {
var count = result.response[i].posts;
if ( count ) {
$('.disqus-comment-count[data-disqus-url="' + result.response[i].link + '"]').html(count);
}
}
}
});
</script>
{% endif %}