luizpedone/lastfm

Wrapper of the last.fm API.

dev-master 2018-03-04 15:10 UTC

This package is not auto-updated.

Last update: 2024-05-17 07:49:49 UTC


README

Maintainability Test Coverage CircleCI

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();
}