Developed with love by KnpLabs Hire us for your project!
34

SpotifyApiBundle

by mmoreram

Spotify Api Bundle for Symfony2

SpotifyApiBundle for Symfony2

SensioLabsInsight
Scrutinizer Quality Score
Latest Stable Version
Latest Unstable Version
Dependency Status
Total Downloads

This bundle is only a wrapper of Spotify Api for all Symfony2 developers.
You can find all API specification here

Table of contents

  1. Installing/Configuring
  2. API Search
  3. API Lookup
  4. Contribute

Installing/Configuring

Tags

  • Use version 1.0-dev for last updated. Alias of dev-master.
  • Use last stable version tag to stay in a stable release.

Installing SpotifyApiBundle

You have to add require line into you composer.json file

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",

    "mmoreram/spotify-api-bundle": "dev-master"
}

Then you have to use composer to update your project dependencies

$ php composer.phar update

And register the bundle in your appkernel.php file

return array(
    // ...
    new Mmoreram\SpotifyApiBundle\SpotifyApiBundle(),
    // ...
);

API Search

You can search a simple artist name, getting an array of Artists, with a maximum of 100 results

$page = 1;

$artists = $this
    ->container
    ->get('spotify.api.search')
    ->findArtist('Hans Zimmer', $page);

You can also search also a simple artist name, getting only first Artist

$artists = $this
    ->container
    ->get('spotify.api.search')
    ->findFirstArtist('Hans Zimmer');

You can search a simple Album name, getting an array of Albums, with a maximum of 100 results

$page = 1;

$albums = $this
    ->container
    ->get('spotify.api.search')
    ->findAlbums("Pirate of the Caribbean, at world's end", $page);

You can also search also a simple artist name, getting only first Artist

$albums = $this
    ->container
    ->get('spotify.api.search')
    ->findFirstAlbum("Pirate of the Caribbean, at world's end");

You can search a simple Track name, getting an array of Tracks, with a maximum of 100 results

$page = 1;

$tracks = $this
    ->container
    ->get('spotify.api.search')
    ->findTracks("I don't think now is the best time", $page);

You can also search also a simple artist name, getting only first Artist

$tracks = $this
    ->container
    ->get('spotify.api.search')
    ->findFirstTrack("I don't think now is the best time");

API Lookup

Given an artist code, you can get all related information by using the Spitify Api Lookup service

$artist = $this
    ->container
    ->get('spotify.api.search')
    ->getArtist('spotify:artist:0YC192cP3KPCRWx8zr8MfZ');

Given an album code, you can also get all related information it

$album = $this
    ->container
    ->get('spotify.api.search')
    ->getAlbum('spotify:album:6JoI0NEAqeJ20X6lU3Drx0');

And given a track code, you can also get all related information about it

$track = $this
    ->container
    ->get('spotify.api.search')
    ->getTrack('spotify:track:5sbwYsgzeg7wsug1A1pTiO');

Contribute

All code is Symfony2 Code formatted, so every pull request must validate phpcs standards.
You should read Symfony2 coding standards and install this CodeSniffer to check all code is validated.

There is also a policy for contributing to this project. All pull request must be all explained step by step, to make us more understandable and easier to merge pull request. All new features must be tested with PHPUnit.

If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section and use the Pull Request Template.

Bitdeli Badge

Copyright (c) Marc Morera <yuhu@mmoreram.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE
spotify_api:          []
  • Add a Bitdeli badge to README
    By bitdeli-chef, 5 years ago
  • Merge pull request #8 from bitdeli-chef/master
    By mmoreram, 5 years ago
  • Merge pull request #7 from mhor/patch-1
    By mmoreram, 5 years ago
  • fix badges url + syntax highlighting
    By mhor, 5 years ago
  • Some phpcs from php-cs-fixer project
    By mmoreram, 5 years ago
  • Readme code block format
    By mmoreram, 5 years ago
  • Added some new info in README
    By mmoreram, 5 years ago
  • Update README.md
    By mmoreram, 5 years ago
  • Updated tags documentation
    By mmoreram, 5 years ago
  • Update badges
    By mmoreram, 5 years ago
  • Added maximum-stability as stable and tagged unstable
    By mmoreram, 5 years ago
  • Added Nb of packagist downloads in README
    By mmoreram, 5 years ago
  • Added SensioLabs Insight badge
    By mmoreram, 5 years ago
  • Fixed some style and SensioLabs Insight errors
    By mmoreram, 5 years ago
  • Update .gitignore
    By mmoreram, 5 years ago
  • Merge pull request #2 from mauromurru/master
    By mmoreram, 5 years ago
  • Map track length
    By Mauro Murru, 5 years ago
  • Merge pull request #1 from mauromurru/master
    By mmoreram, 5 years ago
  • Correct in
    By Mauro Murru, 5 years ago
  • Update README.md
    By mmoreram, 5 years ago
  • Added some info in readme
    By mmoreram, 5 years ago
  • Added scrutinizer badge to README.md
    By mmoreram, 5 years ago
  • Updated README.me with valid content
    By mmoreram, 5 years ago
  • Fixed some CS
    By mmoreram, 5 years ago
  • First upload
    By mmoreram, 5 years ago