zetaphor/reddit-api-client
Composer 安装命令:
composer require zetaphor/reddit-api-client
包简介
Provides an interface to the API at reddit.com
README 文档
README
This is a PHP client for Reddit's API, built on the Guzzle web service client framework.
As a quick taster, here's some sample code:
<?php require 'vendor/autoload.php'; $clientFactory = new Reddit\Api\Client\Factory; $client = $clientFactory->createClient(); $login = $client->getCommand( 'Login', array( 'api_type' => 'json', 'user' => 'Example_User', 'passwd' => 'password123', ) ); $login->execute(); $submit = $client->getCommand( 'Submit', array( 'sr' => 'programming', 'kind' => 'link', 'title' => 'Mongo DB Is Web Scale', 'url' => 'http://www.youtube.com/watch?v=b2F-DItXtZs', ) ); $submit->execute();
Installation
This project is packaged with Composer. Add the
following the the require section of your project's composer.json:
"zetaphor/reddit-api-client": "dev-master"
After that just run php composer.phar update and you're good to go! If you
have any trouble, or want more detail, I've set up a working example "Reddit
Console" project for reference purposes.
Development Status
Reddit's API is big, and the service description JSON in the
./api/ directory
is incomplete.
Supported URIs
api/login/{user}api/me.jsonapi/registerapi/submitapi/delapi/voteapi/commentapi/messageby_id/t3_{id}.jsonr/{subreddit}.jsonuser/{id}.jsonuser/{id}/about.json
The above list covers many of the most common interactions such as logging in, reading and posting links and comments, and casting votes. However, there are dozens more services available in Reddit's API, and simple pull requests adding entries to the service description JSON are very welcome.
Contributing
This is a fairly simple project so there aren't many guidelines. If you've fixed a bug or added a feature, let's get it merged back in. There are two hard rules.
1. Test-drive your changes
This project is test-driven. Please don't submit any code changes without a corresponding set of unit tests.
$ make phpunit
2. Follow PSR2
Stick to the PSR-2 standard.
$ make phpcs
License
This project is released under the MIT License.
zetaphor/reddit-api-client 适用场景与选型建议
zetaphor/reddit-api-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.72k 次下载、GitHub Stars 达 72, 最近一次更新时间为 2015 年 12 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「client」 「reddit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zetaphor/reddit-api-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zetaphor/reddit-api-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zetaphor/reddit-api-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Library to validate and parse social media profile URLs
Laravel Reddit API wrapper
A PSR-7 compatible library for making CRUD API endpoints
Mock PSR-18 HTTP client
Asynchronous MQTT client built on React
Addon to enable social login providers for the Miniframe PHP Framework.
统计信息
- 总下载量: 2.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 72
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-03