cydh / idrowikiapi
An API for DB.IDROWIKI.org project
v1.0.0
2019-08-19 09:32 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2024-09-19 21:52:26 UTC
README
PHP API library for DB.IDROWIKI.org
Requirements
- PHP 5.6 or newer
- Composer
Installation
If you willing to use this as component,
composer require cydh/idrowikiapi
or download latest version then install it by using composer
composer install
Usage
Then include autoload in PHP file (example: whodrops.php)
require_once './vendor/autoload.php'; use Cydh\IdrowikiAPI; $db = new IdrowikiAPI\IdrowikiAPI(IdrowikiAPI\ApiType::ITEM_DROPLIST, 608); // Yggdrasil Berry $db->setEndpoint("https://db.idrowiki.org/renewal/api/"); $db->setAuthKey("IDROWIKIAPIKEY"); $db->execute(); if ($db->isSuccess()) { var_dump($db->simplePrint()); var_dump($db->getLink()); } else { print "Error with code '".$db->getErrorCode()."'. Message: ".$db->getErrorMessage().PHP_EOL; }
Available API Types
See inside file src/ApiType.php
there are constants
use Cydh\IdrowikiAPI\ApiType;