javascript - 是否可以使用 Disqus API 从特定 url 获取评论?

标签 javascript json cross-domain disqus

我也想仅在可能的情况下使用 javascript 客户端脚本来执行此操作。

最佳答案

您始终可以将 jQuery 用于 AJAX 调用,因为 Disqus 上的几乎所有内容现在都可用。

首先,您必须使用 (http://disqus.com/api/docs/threads/list/) 获取线程 ID:

http://disqus.com/api/3.0/threads/list.json?api_key=API_PUBLIC_KEY_HERE&forum=[shortforumid]&thread=link:[链接]

最重要的部分是 thread= 有 link:[link] 作为链接:表示我们正在使用 URL。

获取到线程id后,需要访问(http://disqus.com/api/docs/posts/list/):

http://disqus.com/api/3.0/posts/list.json?api_key=API_PUBLIC_KEY_HERE&thread=[线程 ID]

提醒一下,括号里不需要...

关于javascript - 是否可以使用 Disqus API 从特定 url 获取评论?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4755278/

相关文章:

javascript - 使用内联样式 ReactJS 根据滚动值旋转图像

java - 将 JSON 解析为 Map

python - 将 JSONField 转换为 TextField 后格式错误

javascript - IE9 "Access is Denied"错误,访问IFrame时

php - 当用户更改其系统日期时,由于 SSL 证书无效,JS 无法正常工作

javascript - 独立指令绑定(bind)到父函数

javascript - ng-repeat 的性能

openid - 使用 OpenID 登录多个域 : Is this plan feasable?

JavaScript For 循环在代码中的某一行之后不起作用

PHP MySQL JSON 登录系统