mirror of
https://github.com/joostfaassen/vndb-client-php.git
synced 2024-05-17 00:18:23 +03:00
Create README.md
Initial README.md
This commit is contained in:
parent
d6797bca95
commit
9c42d4a76c
33
README.md
Normal file
33
README.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# vndb-client-php
|
||||
|
||||
A vndb.org client for PHP. It can be used both as a PHP library and as a stand-alone CLI tool
|
||||
|
||||
## Library usage:
|
||||
|
||||
```php
|
||||
use VndbClient\Client;
|
||||
|
||||
$client = new Client();
|
||||
$client->connect();
|
||||
$client->login($username, $password);
|
||||
$res = $client->sendCommand('dbstats'); // send raw command
|
||||
$res = $client->getVisualNovelDataById(5);
|
||||
$res = $client->getReleaseDataById(21446);
|
||||
$res = $client->getProducerDataById(24);
|
||||
$res = $client->getCharacterDataById(537);
|
||||
```
|
||||
All methods return a `VndbClient\Response` object, containing `->getType()` and `->getData()` methods to read the response.
|
||||
|
||||
## CLI usage
|
||||
|
||||
```
|
||||
./bin/vndb-client vndb:getbyid your_username your_password vn 5
|
||||
./bin/vndb-client vndb:getbyid your_username your_password release 5
|
||||
./bin/vndb-client vndb:getbyid your_username your_password producer 5
|
||||
./bin/vndb-client vndb:getbyid your_username your_password character 5
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue