Encyclopedia API documentation you can see here.
Pretty simple with Composer, run:
composer require anime-db/anime-news-network-browser-bundle
Add AnimeDbAnimeNewsNetworkBrowserBundle to your application kernel
// app/appKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new AnimeDb\Bundle\AnimeNewsNetworkBrowserBundle\AnimeDbAnimeNewsNetworkBrowserBundle(),
);
}
anime_db_anime_news_network_browser:
# Host name
# As a default used 'https://cdn.animenewsnetwork.cc'
host: 'https://cdn.animenewsnetwork.cc'
# Reports
# As a default used '/encyclopedia/reports.xml'
reports: '/encyclopedia/reports.xml'
# Anime/Manga Details
# As a default used '/encyclopedia/api.xml'
details: '/encyclopedia/api.xml'
# HTTP User-Agent
# No default value
client: 'My Custom Bot 1.0'
First get browser
$browser = $this->get('anime_db.anime_news_network.browser');
Detail info about anime Jinki:Extend.
$xml = $browser->details(['query' => ['anime' => 4658]]);
or
$xml = $browser->details(['query' => ['title' => 4658]]);
Detail info about manga Berserk.
$xml = $browser->details(['query' => ['manga' => 2298]]);
or
$xml = $browser->details(['query' => ['title' => 2298]]);
Anime/Manga list
$xml = $browser->reports(155);
People by Kanji name
$xml = $browser->reports(165, ['query' => ['nskip' => 20, 'nlist' => 10]]);
All reports you can see here.
use AnimeDb\Bundle\AnimeNewsNetworkBrowserBundle\Exception\NotFoundException;
try {
$content = $browser->details(['query' => ['anime' => 4658]]);
} catch (NotFoundException $e) {
// page not found
} catch (\Exception $e) {
// other exceptions
}
You can customize request options. See Guzzle Documentation.
This bundle is under the GPL v3 license. See the complete license in the file: LICENSE