Disqus API 用法 How to get your Disqus API keys

I’m working on importing my comments into the otherwise excellent Disqus commenting system, but getting ahold of your API keys can be rather difficult, so I’ll just document the process here for later reference.

 

To call the API functions, I’m using the Java-based REST Client – which is free and very handy for this kind of thing.

 

  1. Log in to Disqus.com with a user that has access to the forum you want API keys for.
  2. Visit http://disqus.com/api/get_my_key/ with your browser to get the user API key (since it uses the active session to give you the API key).
  3. Call http://disqus.com/api/get_forum_list/?user_api_key= _USER_API_KEY_ to get the list of available forums, since you’ll need the numeric identifier for the forum. Look through the JSON response and find the id number for the forum you want an API key for (for my blog, it’s "id": "180233" ).
  4. Call http://disqus.com/api/get_forum_api_key/?user_api_key =_USER_API_KEY_&forum_id=180233 where 180233 is your forum id. The message field in the JSON response should contain your API key.

 

That’s quite a bit of manual work, but it does not seem like there’s currently any better method. If you happen to find one, please let me know.

 

来源:http://mikkel.hoegh.org/blog/2009/09/15/how-get-your-disqus-api-keys/

 

或者 http://disqus.com/api/docs/   -> Applications

 

 

 api 使用方法:

require_once 'disqusapi/disqusapi.php';

$secret_key="**************************************";
$disqus = new DisqusAPI($secret_key);

$from_timestamp=time()-3*24*60*60;
$param = array('forum'=>'(shortname)','limit'=>'100','since'=>$from_timestamp)

// most popular
$arr=$disqus->threads->listPopular($param);

// the latest
//$arr=$disqus->forums->listPosts($param);

 

 

http://www.disqus.com/api/docs/

https://github.com/disqus/disqus-php

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值