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

echonest_resource

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

echonest_resource

  • 0.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Echonest gem

Installation

Add the gem to your Gemfile

	gem "echonest_resource"

Obtain an API key from echonest and create a file called 'echonest.yml' in your /config directory

	api_key = "YOUR_API_KEY"

Usage

Right now the gem supports two Echonest resources: Artist and Song

Artist

class Artist < ActiveResource::Base
	include EchonestResource::Base
	echonest_resource :artist
end
class Artist < ActiveResource::Base
	include EchonestResource::Base
	echonest_resource :song
end

Now you can search for an artist:

artists = Artist.search("Macklemore")

The search method also accepts an options hash where you can specify things like: results, bucket, sort

artists = Artist.search("Macklemore", {:results => 20, :sort => "hotttnesss-desc"})

Song

You can search for songs for an artist name

songs = Song.find_by_artist_name("Macklemore")

The find_by_artist_name method also accepts an options hash

songs = Song.find_by_artist_name("Macklemore", :sort => "song_hotttnesss")

You can retrieve additional information by specifying a bucket like so:

songs = Song.find_by_artist_name("Macklemore", :bucket => "audio_summary", :results => 20)

All the attributes on the songs use the same name as the Echonest API (http://developer.echonest.com/docs/v4)

FAQs

Package last updated on 27 Feb 2012

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