compwright / disguz
基于Guzzle的Disqus API的PHP客户端
0.0.3
2014-12-18 16:02 UTC
Requires
- php: >=5.4
- guzzle/guzzle: 3.*
This package is auto-updated.
Last update: 2024-09-22 15:57:57 UTC
README
基于Guzzle 3 PHP库的非官方Disqus API客户端。
用法
通过调用工厂方法来获取Disguz实例。传递一个配置设置数组
$config = [ 'api_key' => getenv('DISQUS_API_KEY'), 'api_secret' => getenv('DISQUS_API_SECRET'), 'access_token' => getenv('DISQUS_ACCESS_TOKEN'), ]; $client = Disguz::factory($config);
然后调用支持的方法之一。将方法参数作为数组传递
$params = [ 'message' => 'This is another test post', 'thread' => $argv[1], ]; $result = $client->postsCreate($params);
支持的方法
以下方法目前受支持。有关这些API方法的文档,请访问https://disqus.com/api。
对其他方法的支持只需在src/resources/disqus.json
中记录它们,遵循Guzzle文档。请随时提交一个拉取请求,将Disqus API中您可能需要的任何方法添加到此文件。