以下代码用于获取 Disqus 对多个页面的评论计数。
var DISQUSWIDGETS;
if (typeof DISQUSWIDGETS != 'undefined') {
DISQUSWIDGETS.displayCount({
"showReactions":true,
"text":{
"and":"and",
"reactions":{
"zero":"0 Reactions",
"multiple":"{num} Reactions",
"one":"1 Reaction"},
"comments":{
"zero":"0 Comments",
"multiple":"{num} Comments",
"one":"1 Comment"
}
},
"counts":[
{"reactions":0,"uid":1,"comments":2},
{"reactions":0,"uid":2,"comments":5},
{"reactions":0,"uid":3,"comments":9}
]
});
}
我想从这里获得评论的数量示例:
{"reactions":0,"uid":1,"comments":2}
评论数应为 2。
是否有任何 javascript 代码只会得到评论?