2017 © Pedro Peláez
 

symfony-bundle lastfm-bundle

Use Last.fm API in your Symfony 2 application.

image

binarythinking/lastfm-bundle

Use Last.fm API in your Symfony 2 application.

  • Monday, August 22, 2016
  • by karolsojko
  • Repository
  • 8 Watchers
  • 15 Stars
  • 86 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

BinaryThinking/LastfmBundle

Build Status, (*1)

Symfony 2 Bundle for Last.fm API, (*2)

This is a Bundle that will help you communicate with Last.fm's API., (*3)

Status

The Bundle handles API methods for following contexts (Please see Milestones on github): - Album - Artist - Chart - Geo - Library - Tag - User, (*4)

Stay tuned for more coming soon., (*5)

Installation

If you're using composer just add:, (*6)

{
    "require": {
        "binarythinking/lastfm-bundle": "dev-master"
    }
}

If you're using a deps file just add:, (*7)

[BinaryThinkingLastfmBundle]
    target=/bundles/BinaryThinking/LastfmBundle
    git=http://github.com/karolsojko/BinaryThinkingLastfmBundle.git

Register the BinaryThinking namespace in autoload.php, (*8)

<?php
$loader->add('BinaryThinking', __DIR__ . '/../vendor/bundles');

And the bundle to AppKernel.php, (*9)

<?php
$bundles = array(
  // ...
  new BinaryThinking\LastfmBundle\BinaryThinkingLastfmBundle()
);

Configuration

After installing just configure your application with your Last.fm API key and secret., (*10)

In your config define those two as:, (*11)

binary_thinking_lastfm:
  client_apikey: "my_api_key"
  client_secret: "my_secret"

Using

In your controller if you want for example a client for the album API context just get the service like this:, (*12)

<?php
$albumClient = $this->get('binary_thinking_lastfm.client.album');

Or you can get the client factory and request for a specific client f.e. album:, (*13)

<?php
$clientFactory = $this->get('binary_thinking_lastfm.client_factory');
$albumClient = $clientFactory->getClient('album', $apiKey, $apiSecret);

Once you have your client you can use on it the methods that are available in the Last.fm API f.e., (*14)

<?php
// search for an album
$albums = $albumClient->search('Sound of perseverance');

// get detailed info on an album
$album = $albumClient->getInfo('Cynic', 'Focus');

The Versions

22/08 2016

dev-master

9999999-dev

Use Last.fm API in your Symfony 2 application.

  Sources   Download

MIT

The Requires

 

api lastfm last.fm