nass600/lyrics-bundle

Symfony2 扩展包,用于通过 REST API 获取专辑歌词

安装: 18

依赖者: 0

建议者: 0

安全性: 0

星星: 1

关注者: 2

分支: 1

开放问题: 0

类型:symfony-bundle

dev-master 2012-07-23 19:11 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:55:47 UTC


README

LyricsBundle 提供访问多个提供音乐曲目歌词数据的网络服务,并通过通用接口抽象它们的 API。允许您搜索歌词并获取和操作它们。

安装

将 LyricsBundle 添加到 vendor/bundles/ 目录。

在您的 deps 文件中添加以下行

[LyricsBundle]
  git =https://github.com/nass600/LyricsBundle.git
  target=/bundles/nass600/LyricsBundle
  version=master

运行 vendors 脚本

./bin/vendors install

将 nass600 命名空间添加到您的 app/autoload.php

// app/autoload.php
$loader->registerNamespaces(array(
    // your other namespaces
    'nass600' => __DIR__.'/../vendor/bundles',
);

将 LyricsBundle 添加到您的 app/AppKernel.php

// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Nass600\LyricsBundle\nass600LyricsBundle(),
    );
}

配置

将歌词类适配器添加到您的 app/config.yml

nass600_lyrics:
    provider: Nass600\LyricsBundle\Adapter\LyrDBAdapter

默认情况下设置为使用 LyrDB API 以提供最佳歌词服务 API,除非您想使用其他 API,否则无需添加此配置条目

用法

SearchLyrics

只需访问服务并搜索特定曲目,并指定输出格式

$this->get('nass600.lyrics.manager')->searchLyrics("MICHAEL JACKSON Don't stop til get enough", "json");

GetLyrics

使用服务,通过传递对应于所使用网络服务的相应曲目 ID 和输出格式来获取歌词

$this->get('nass600.lyrics.manager')->getLyrics("170987", 'text');

许可证

此扩展包受 GNU 许可证保护。完整的许可证请参阅

LICENSE

作者

  • Ignacio Velázquez Gómez

致谢

此扩展包获取以下免费网络服务的信息

LyrDB (http://www.lyrdb.com)

待办事项

  • 单元测试