定制 matto1990/lastfm-api 二次开发

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

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

matto1990/lastfm-api

Composer 安装命令:

composer require matto1990/lastfm-api

包简介

Last.fm webservice client

README 文档

README

Thank you for using PHP Last.FM API!

You will need your own API key by registering at: http://www.last.fm/api

Installation

composer require matto1990/lastfm-api

Usage

use LastFmApi\Api\AuthApi;
use LastFmApi\Api\ArtistApi;

class LastFm
{
    private $apiKey;
    private $artistApi;

    public function __construct()
    {
        $this->apiKey = 'apikeyfromlastfm'; //required
        $auth = new AuthApi('setsession', array('apiKey' => $this->apiKey));
        $this->artistApi = new ArtistApi($auth);
    }
    public function getBio($artist)
    {
        $artistInfo = $this->artistApi->getInfo(array("artist" => $artist));

        return $artistInfo['bio'];
    }	
}

Testing

To run phpunit successfully, a .env file must be included in tests/Api:

lastfm_api_key=
lastfm_api_secret=
lastfm_token=
lastfm_session_key=
lastfm_username=

If you just want to run the tests that don't need authentication: vendor/bin/phpunit --group notAuthenticated. In this case you'll only need to set lastfm_api_key property.

统计信息

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

GitHub 信息

  • Stars: 107
  • Watchers: 8
  • Forks: 46
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固