https://github.com/anime-db/world-art-browser-bundle
World-Art.ru API browser
https://github.com/anime-db/world-art-browser-bundle
browser php plugin world-art
Last synced: about 2 months ago
JSON representation
World-Art.ru API browser
- Host: GitHub
- URL: https://github.com/anime-db/world-art-browser-bundle
- Owner: anime-db
- License: gpl-3.0
- Created: 2015-10-01T15:13:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T09:49:51.000Z (almost 8 years ago)
- Last Synced: 2025-02-14T21:54:58.563Z (4 months ago)
- Topics: browser, php, plugin, world-art
- Language: PHP
- Size: 72.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://www.world-art.ru)
[](https://packagist.org/packages/anime-db/world-art-browser-bundle)
[](https://packagist.org/packages/anime-db/world-art-browser-bundle)
[](https://travis-ci.org/anime-db/world-art-browser-bundle)
[](https://coveralls.io/github/anime-db/world-art-browser-bundle?branch=master)
[](https://scrutinizer-ci.com/g/anime-db/world-art-browser-bundle/?branch=master)
[](https://insight.sensiolabs.com/projects/ecc1f470-e9f7-4972-b503-7ee0d77de3ab)
[](https://styleci.io/repos/43503665)
[](https://github.com/anime-db/world-art-browser-bundle)World-Art.ru API browser
========================Installation
------------Pretty simple with [Composer](http://packagist.org), run:
```sh
composer require anime-db/world-art-browser-bundle
```Add AnimeDbWorldArtBrowserBundle to your application kernel
```php
// app/appKernel.phppublic function registerBundles()
{
$bundles = array(
// ...
new AnimeDb\Bundle\WorldArtBrowserBundle\AnimeDbWorldArtBrowserBundle(),
);
}
```Configuration
-------------```yml
anime_db_world_art_browser:
# Host name
# As a default used 'http://www.world-art.ru'
host: 'http://www.world-art.ru'# HTTP User-Agent
# No default value
client: 'My Custom Bot 1.0'
```Usage
-----First get browser
```php
$browser = $this->get('anime_db.world_art.browser');
```Get info for anime [Akira](http://www.world-art.ru/animation/animation.php?id=1):
```php
$content = $browser->get('/animation/animation.php?id=1');
```Catch exceptions
```php
use AnimeDb\Bundle\WorldArtBrowserBundle\Exception\BannedException;
use AnimeDb\Bundle\WorldArtBrowserBundle\Exception\NotFoundException;try {
$content = $browser->get('/animation/animation.php?id=1');
} catch (BannedException $e) {
// you are banned
} catch (NotFoundException $e) {
// page 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