luizpedone / lastfm
Wrapper of the last.fm API.
dev-master
2018-03-04 15:10 UTC
Requires
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- codeclimate/php-test-reporter: @dev
- mockery/mockery: ^1.0
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2024-05-17 07:49:49 UTC
README
This package wraps the last.fm API in a easy to use PHP package. This package is under development at the moment.
Installation
To install it using composer just execute the following command:
composer require luizpedone/lastfm
How to use it
<?php $lastFm = new \LuizPedone\LastFM\LastFM('your-last-fm-api-key'); $topArtists = $lastFm->user() ->topArtists('luiz-pedone') ->period(Period::LAST_MONTH) ->limit(10) ->get(); // Outputs an array of \LuizPedone\LastFM\User\Entity\TopArtist objects foreach ($topArtists as $topArtist) { echo $topArtist->getName(); echo $topArtist->getPlayCount(); }