luizpedone / lastfm
Wrapper of the last.fm API.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/luizpedone/lastfm
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: 2025-12-26 15:41:38 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(); }