pouler/spotify-charts-api
Composer 安装命令:
composer require pouler/spotify-charts-api
包简介
PHP Wrapper for spotifycharts.com
README 文档
README
This is a PHP wrapper for spotifycharts.com
Requirements
- PHP ^7.4|^8.0
Installation
Install it using Composer:
composer require pouler/spotify-charts-api
Spotify login
You can obtain an access token by using the SpotifyLogin class, this dependency can be installed by using:
composer require pouler/spotify-login
For more information about this project see: https://github.com/PouleR/spotify-login
Example usage
<?php declare(strict_types=1); require 'vendor/autoload.php'; $httpClient = new \Symfony\Component\HttpClient\CurlHttpClient(); $apiClient = new \PouleR\SpotifyChartsAPI\SpotifyChartsAPIClient($httpClient); $spotifyApi = new \PouleR\SpotifyChartsAPI\SpotifyChartsAPI($apiClient); $spotifyApi->setAccessToken('access.token'); $charts = $spotifyApi->getRegionalTopSongs('nl', 'weekly'); echo $result->getDisplayChart()->getChartMetadata()->getReadableTitle() . PHP_EOL; foreach ($charts->getEntries() as $entry) { echo $entry->getChartEntryData()->getCurrentRank() . ' --> ' . $entry->getTrackMetadata()->getTrackName() . PHP_EOL; }
统计信息
- 总下载量: 2.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-12