https://github.com/anime-db/ani-db-browser-bundle
Browser for AniDB.net
https://github.com/anime-db/ani-db-browser-bundle
anidb browser php plugin
Last synced: 3 months ago
JSON representation
Browser for AniDB.net
- Host: GitHub
- URL: https://github.com/anime-db/ani-db-browser-bundle
- Owner: anime-db
- License: gpl-3.0
- Created: 2014-04-24T08:33:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-08-14T18:55:31.000Z (almost 8 years ago)
- Last Synced: 2024-11-18T06:58:07.071Z (6 months ago)
- Topics: anidb, browser, php, plugin
- Language: PHP
- Size: 170 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://anidb.net/)
[](https://packagist.org/packages/anime-db/ani-db-browser-bundle)
[](https://packagist.org/packages/anime-db/ani-db-browser-bundle)
[](https://travis-ci.org/anime-db/ani-db-browser-bundle)
[](https://coveralls.io/github/anime-db/ani-db-browser-bundle?branch=master)
[](https://scrutinizer-ci.com/g/anime-db/ani-db-browser-bundle/?branch=master)
[](https://insight.sensiolabs.com/projects/0e383920-eaf5-474a-b998-a00462485827)
[](https://styleci.io/repos/19101337)
[](https://github.com/anime-db/ani-db-browser-bundle)Browser for AniDB.net
=====================Read API documentation here: http://wiki.anidb.net/w/HTTP_API_Definition
Installation
------------Pretty simple with [Composer](http://packagist.org), run:
```sh
composer require anime-db/ani-db-browser-bundle
```Add AnimeDbAniDbBrowserBundle to your application kernel
```php
// app/appKernel.phppublic function registerBundles()
{
$bundles = array(
// ...
new AnimeDb\Bundle\AniDbBrowserBundle\AnimeDbAniDbBrowserBundle(),
);
}
```Configuration
-------------```yml
# app/config/config.ymlanime_db_ani_db_browser:
api:
# API host
# As a default used 'http://api.anidb.net:9001'
host: 'http://api.anidb.net:9001'# Prefix for API resurces
# As a default used '/httpapi/'
prefix: '/httpapi/'# API version
# As a default used '1'
protover: 1# You must register a client and use it here.
# See for more info:
# - http://anidb.net/perl-bin/animedb.pl?show=client
# - https://wiki.anidb.net/w/UDP_Clients
# - https://wiki.anidb.net/w/UDP_API_Definition
app:
# Verion of your client.
version: 1# Your client name.
# You point it at registration here: http://anidb.net/perl-bin/animedb.pl?show=client
client: 'my_home_client'# Your client code.
# You will receive it after registration.
code: 'api-team-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
```Usage
-----First get a browser
```php
$browser = $this->get('anime_db.ani_db.browser');
```Get data for anime [Seikai no Monshou](http://anidb.net/perl-bin/animedb.pl?show=anime&aid=1)
([wiki](https://wiki.anidb.info/w/HTTP_API_Definition#Anime)):```php
$content = $browser->get(['query' => ['request' => 'anime', 'aid' => 1]]);
```Catch exceptions
```php
use AnimeDb\Bundle\AniDbBrowserBundle\Exception\BannedException;
use AnimeDb\Bundle\AniDbBrowserBundle\Exception\NotFoundException;try {
$content = $browser->get('anime?aid=1');
} catch (BannedException $e) {
// you are banned
} catch (NotFoundException $e) {
// anime not found
} catch (\Exception $e) {
// other exceptions
}
```You can customize request options. See [Guzzle Documentation](http://docs.guzzlephp.org/en/stable/request-options.html).
License
-------This bundle is under the [GPL v3 license](http://opensource.org/licenses/GPL-3.0).
See the complete license in the file: LICENSE