定制 anime-db/ani-db-browser-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anime-db/ani-db-browser-bundle

Composer 安装命令:

composer require anime-db/ani-db-browser-bundle

包简介

Plugin AniDB for the catalog Anime DB

README 文档

README

Browser for AniDB.net

Latest Stable Version Total Downloads Build Status Coverage Status Scrutinizer Code Quality SensioLabs Insight StyleCI License

Browser for AniDB.net

Read API documentation here: http://wiki.anidb.net/w/HTTP_API_Definition

Installation

Pretty simple with Composer, run:

composer require anime-db/ani-db-browser-bundle

Add AnimeDbAniDbBrowserBundle to your application kernel

// app/appKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AnimeDb\Bundle\AniDbBrowserBundle\AnimeDbAniDbBrowserBundle(),
    );
}

Configuration

# app/config/config.yml

anime_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

$browser = $this->get('anime_db.ani_db.browser');

Get data for anime Seikai no Monshou (wiki):

$content = $browser->get(['query' => ['request' => 'anime', 'aid' => 1]]);

Catch exceptions

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.

License

This bundle is under the GPL v3 license. See the complete license in the file: LICENSE

统计信息

  • 总下载量: 1.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2014-04-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固