alanly/picnik
最新稳定版本:v0.1.5
Composer 安装命令:
composer require alanly/picnik
包简介
A modern, Composer and PSR-4 compatible PHP library for interfacing with the Wordnik API.
README 文档
README
Picnik is a simple PHP client for the Wordnik API, that is Composer and PSR-4 compatible.
Its only dependencies are the GuzzleHttp client and PHP >= 5.4.
API Coverage
The initial goal is to support the word selection of methods.
Currently, the /word.json/{word} and /word.json/{word}/definitions API
methods are implemented.
Usage
In order to use the client, you will first need to obtain an API key from Wordnik.
The client is pretty simple to use,
$client = new Picnik\Client; $client->setApiKey('foobar'); $definitions = $client->wordDefinitions('cat') ->limit(1) ->includeRelated(false) ->useCanonical(true) ->get(); var_dump( count($definitions) ); // int(1) var_dump( $definitions[0]->text ) // string(189) "A small carnivorous mammal (Felis catus or F. domesticus) // domesticated since early times as a catcher of rats and mice and as a pet // and existing in several distinctive breeds and varieties."
License
This library is released under the MIT license. For details, you can refer to the full license document.
统计信息
- 总下载量: 791
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-20