输入评论时 Disqus 事件?

Disqus events when comment is entered?

我打算在我的网站上使用 Disqus。它有一个 "blog" 风格的布局。在首页上,我想显示每个博客条目的评论数。我知道我可以连接到 Disqus 以获取计数,但我更愿意只保存评论 - 当有人输入评论时,直接将计数计入我的数据库以获取博客条目。

所以获取计数不会影响主页的performance/load时间。如果有人在我的页面上输入了我可以收听的评论,是否会触发任何事件?

AngularJS 会是一个奖励,但简单的 javascript 或 jQuery 解决方案也会有所帮助。

function disqus_config() {
    this.callbacks.onNewComment = this.callbacks.onNewComment || [];
    this.callbacks.onNewComment.push(function(comment) { 
      // Code to store the comment count here.
    });
}

您可以使用它来为某些事件添加回调并连接到自定义分析系统。 (例如,将事件发送到 Google Analytics 也是如此。在这里,您只需要向您的计数器端点发出请求。

更多信息在这里:https://help.disqus.com/customer/portal/articles/466258-capturing-disqus-commenting-activity-via-callbacks