tomvlk / maniacalendar-php-sdk
PHP语言的ManiaCalendar API SDK
1.0.1
2015-05-31 14:18 UTC
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
Requires (Dev)
- php: >=5.4.0
- ext-curl: *
- ext-json: *
- phpunit/phpunit: 4.5.1
This package is auto-updated.
Last update: 2024-09-08 01:34:20 UTC
README
PHP语言的ManiaCalendar API SDK
PHP语言的ManiaCalendar API SDK
安装
使用Composer安装并使用SDK。
composer require 'tomvlk/maniacalendar-php-sdk:dev-master'
另外,您也可以手动下载并安装,但最好保持Composer的最新状态,这也很简单。
API密钥
要使用API,您需要获取一个API密钥。这很简单,也很快捷,只需在此处获取API密钥即可
http://api.maniacalendar.com/doc/keys
使用方法
您可以使用大多数可用的方法。目前您可以使用
- 获取活动 (/events/).
- 获取活动详情 (/event/[id]).
- 获取活动的日期。
- 获取所有标题 (/titles/) 以进行筛选。
- 获取所有样式 (/styles/),或用于标题,以进行筛选。
要开始,请查看示例文件夹。
您可以使用以下方式获取活动:
require 'vendor/autoload.php'; // Add the autoload file from Composer $eventHandler = new maniacalendar\Event("API KEY HERE"); // This will return a array with the request results. The array will be false and throw an exception on failure. // Array will contain objects when the request was successfully. $events = $eventHandler->getEvents(); // Output the events array var_dump($events);
API文档
API文档可在以下位置找到: http://api.maniacalendar.com/doc/
许可证
请参阅LICENSE文件。