是否可以使用Disqus API从特定网址获取评论?

时间:2011-01-21 04:09:17

标签: javascript json cross-domain disqus

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

2 个答案:

答案 0 :(得分:20)

您可以随时使用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]作为链接:说我们正在使用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= [thread id]

提醒一下,您不需要放入括号......

答案 1 :(得分:1)

接受的答案包括对Disqus API的两次不同调用,以避免限制使用,您只能使用1次调用来获取网址的评论列表:

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