是否可以使用 Disqus API 获取特定网址的评论?
我还想仅在可能的情况下使用 javascript 客户端脚本来执行此操作。
I would also like to do this using javascript client-side scripting only if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您始终可以使用 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:[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]
只是提醒一下,您不需要放在括号中...
You could always use jQuery for the AJAX calls as almost everything on Disqus is now get.
First you would have to get the thread id from using (http://disqus.com/api/docs/threads/list/):
http://disqus.com/api/3.0/threads/list.json?api_key=API_PUBLIC_KEY_HERE&forum=[shortforumid]&thread=link:[link]
The most important part is for the thread= to have link:[link] as the link: says we are using a URL.
After you get the thread id, you will have to visit (http://disqus.com/api/docs/posts/list/):
http://disqus.com/api/3.0/posts/list.json?api_key=API_PUBLIC_KEY_HERE&thread=[thread id]
Just as a reminder, you do not need to put in the brackets...
接受的答案包括对 Disqus API 的 2 次不同调用,为了避免使用限制,您只能使用 1 次调用通过 url 获取评论列表:
http://disqus.com/api/3.0/posts/list.json? api_key=API_PUBLIC_KEY_HERE&forum=[shortforumid]&thread=link:[link]
The accepted answer consists in 2 different calls to Disqus API, to avoid the limit usage you could use only 1 call for obtains a list of comments by an url:
http://disqus.com/api/3.0/posts/list.json?api_key=API_PUBLIC_KEY_HERE&forum=[shortforumid]&thread=link:[link]