itunes

by dewski

dewski / itunes

A Ruby wrapper around the iTunes API that lets you search for any sort of data that is available on ...

126 Stars 28 Forks Last release: Not found MIT License 89 Commits 10 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

iTunes Build Status

A Ruby wrapper around the iTunes API that lets you search for any sort of data that is available on the iTunes store.

Example Response

{
  "artist_id" : 954266,
  "artist_name" : "Green Day",
  "artist_view_url" : "http://itunes.apple.com/us/artist/green-day/id954266?uo=4",
  "artwork_url100" : "http://a1.phobos.apple.com/us/r1000/049/Features/1e/17/05/dj.rpihtiig.100x100-75.jpg",
  "artwork_url30" : "http://a1.phobos.apple.com/us/r1000/049/Features/1e/17/05/dj.rpihtiig.30x30-50.jpg",
  "artwork_url60" : "http://a1.phobos.apple.com/us/r1000/049/Features/1e/17/05/dj.rpihtiig.60x60-50.jpg",
  "collection_censored_name" : "Dookie",
  "collection_explicitness" : "explicit",
  "collection_id" : 5132583,
  "collection_name" : "Dookie",
  "collection_price" : 9.99,
  "collection_view_url" : "http://itunes.apple.com/us/album/she/id5132583?i=5132563&uo=4",
  "content_advisory_rating" : null,
  "country" : "USA",
  "currency" : "USD",
  "disc_count" : 1,
  "disc_number" : 1,
  "kind" : "song",
  "preview_url" : "http://a1.phobos.apple.com/us/r1000/027/Music/0e/86/7a/mzm.wchstext.aac.p.m4a",
  "primary_genre_name" : "Alternative",
  "release_date" : "2003-04-22 07:00:00 Etc/GMT",
  "track_censored_name" : "She",
  "track_count" : 15,
  "track_explicitness" : "notExplicit",
  "track_id" : 5132563,
  "track_name" : "She",
  "track_number" : 8,
  "track_price" : 1.29,
  "track_time_millis" : 134293,
  "track_view_url" : "http://itunes.apple.com/us/album/she/id5132583?i=5132563&uo=4",
  "wrapper_type" : "track"
}

Available Methods

  • movie
  • podcast
  • music
  • music_video
  • audiobook
  • short_film
  • tv_show
  • ebook
  • software
  • all

Using the iTunes gem

require 'itunes'

>> itunes = ITunes::Client.new >> songs = itunes.music('green day she') => >> songs.results.each do |song| >> puts "#{song.track_name} - #{song.artist_name} (#{song.collection_name})" >> end => She - Green Day (Dookie) => She - Green Day (Dookie) => She - Green Day (Dookie) => She - Green Day (Dookie) => She - Green Day (Dookie)

Search directly from the class

>> iron_man = ITunes.movie('iron man 2')
=> 

Limit the results:

>> foo_fighters = ITunes.music('foo fighters everlong', :limit => 1)
=> ]>

What is Hashie::Rash?

If you are familiar with Hashie, Rash is very similar to a Mash. The primary difference is that Rash gives us ruby-friendly keys so instead of artistId, Rash converts that to artist_id.

Copyright

Copyright © 2011 Garrett Bjerkhoel, Steve Agalloco. See MIT-LICENSE for details.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.