Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

meta-spotify

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meta-spotify

  • 0.3.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

meta-spotify

A ruby wrapper for the Spotify Metadata API. See here for usage: http://developer.spotify.com/en/metadata-api/overview/

Use of the API is subject to the Terms and Conditions: http://developer.spotify.com/en/metadata-api/terms-of-use/

Installation

gem install meta-spotify

Usage

The API has two services for the three types of data, artists, albums and tracks:

Lookup

To look up an artist, album or track, simply call:

MetaSpotify::Artist.lookup(spotify_uri)
MetaSpotify::Album.lookup(spotify_uri)

or

MetaSpotify::Track.lookup(spotify_uri)

e.g.

artist = MetaSpotify::Artist.lookup("spotify:artist:4YrKBkKSVeqDamzBPWVnSJ")
#=> #<MetaSpotify::Artist:0x119764c @name="Basement Jaxx">

artist.name
#=> "Basement Jaxx"

You can also call lookup with the extras parameter, but only the acceptable extras will yield results, e.g.

artist = MetaSpotify::Artist.lookup('spotify:artist:4YrKBkKSVeqDamzBPWVnSJ', :extras => 'album')

artist.albums.first.name
#=> "Jaxx Unreleased"

To search for an artist, album or track works the same way as lookup, simply call:

MetaSpotify::Artist.search(search_term)
MetaSpotify::Album.search(search_term)

or MetaSpotify::Track.search(search_term)

e.g.

search = MetaSpotify::Artist.search('foo')

search.artists.first.name
#=> "Foo fighters"

For searches with many results, the result also contains details on pages and you can return page 2 like this:

MetaSpotify::Artist.search('foo', :page => 2)

Disclaimer

This is very new, so please let me know of any problems or anything that is missing.

Copyright (c) 2009 Phil Nash. See LICENSE for details.

FAQs

Package last updated on 21 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc