2017 © Pedro PelĂĄez
 

library lastfm-api

A last.fm API client

image

marvelley/lastfm-api

A last.fm API client

  • Wednesday, November 27, 2013
  • by craigmarvelley
  • Repository
  • 0 Watchers
  • 6 Stars
  • 136 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Last.fm API client

This is a client for the last.fm API. It uses the Guzzle web service library. The client API is a custom web service client based on Guzzle\Service\Client., (*1)

Build Status, (*2)

Installation

Use composer to install the library and all its dependencies:, (*3)

composer require "marvelley/lastfm-api:1.0.*@dev" 

Basic Usage Example

Before you can use the library you have to request your API key on the [last.fm API page][2].
Put that key in the following code and run the code from the command line:, (*4)

require 'vendor/autoload.php';

use Marvelley\Lastfm\Api\LastfmApiClient;

$l = LastfmApiClient::factory(array('api_key' => 'your_api_key'));
$ai = $l->getCommand('artist.getInfo', array(
    'artist' => 'Elvis Presley', 
    "format" => "json"
));
$result = $ai->execute();
echo "Similar artists:\n";
foreach($result['artist']['similar']['artist'] as $artist) {
    printf("  - %s\n", $artist['name']);
}

 Running integration tests

Before running the test suite you need to configure a specific environment variable with a valid last.fm API key. For example, from your terminal:, (*5)

$ export LAST_FM_PHP_CLIENT_API_KEY=your_api_key

or add a similar entry to your bash/zsh/whatever config file., (*6)

You can then run the test suite via:, (*7)

$ phpunit

from the root of the project directory (assuming you have PHPUnit installed and on the path)., (*8)

The Versions

27/11 2013

dev-master

9999999-dev

A last.fm API client

  Sources   Download

MIT

The Requires

 

by Craig Marvelley

guzzle

27/11 2013

v0.1

0.1.0.0

A last.fm API client

  Sources   Download

MIT

The Requires

 

by Craig Marvelley

guzzle

23/09 2013

dev-test-api-key

dev-test-api-key

A last.fm API client

  Sources   Download

MIT

The Requires

 

by Craig Marvelley

guzzle