joostfaassen/vndb-client-php

为vndb.org的API客户端

dev-master 2015-01-03 12:28 UTC

This package is auto-updated.

Last update: 2024-08-29 03:26:16 UTC


README

A vndb.org client for PHP. It can be used both as a PHP library and as a stand-alone CLI tool

库使用

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);

所有方法都返回一个 VndbClient\Response 对象,该对象包含 ->getType()->getData() 方法以读取响应。

CLI使用

./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

VNDB协议

有关此API的工作原理和返回数据的描述,请参阅

    https://vndb.org/d11

Composer / Packagist

此库可在packagist.org上作为 joostfaassen/vndb-client-php 获取

许可证

MIT