Bandsintown.com API gem
A Ruby library for accessing the Bandsintown API.
The Bandsintown API lets any developer access the largest database of upcoming concert listings and concert tickets in the world.
For more information visit www.bandsintown.com/api/requests.
sudo gem install bandsintown
require 'bandsintown'
Bandsintown.app_id = 'YOUR_APP_ID'
artist = Bandsintown::Artist.new({ :name => "The Killers" }) events = artist.events
# 486af4f0-a79b-468f-be73-527cd4caf6ea => mbid for Slick Rick artist = Bandsintown::Artist.new({ :mbid => "486af4f0-a79b-468f-be73-527cd4caf6ea" }) events = artist.events
artist = Bandsintown::Artist.get({ :name => "Raekwon" }) artist.upcoming_events_count => 5 artist.on_tour? => true
# 4e954b02-fae2-4bd7-9547-e055a6ac0527 => mbid for Raekwon artist = Bandsintown::Artist.get({ :mbid => "4e954b02-fae2-4bd7-9547-e055a6ac0527" }) artist.upcoming_events_count => 5 artist.on_tour? => true
events = Bandsintown::Event.search({ :location => 'Boston, MA', :start_date => Time.now, :end_date => 1.week.from_now })
events = Bandsintown::Event.search({ :artists => ['Mos Def', 'Talib Kweli'], :start_date => Time.now, :end_date => 1.week.from_now })
# 3b39abeb-0064-4eed-9ddd-ee47a45c54cb => mbid for Ghostface Killah # 4e954b02-fae2-4bd7-9547-e055a6ac0527 => mbid for Raekwon events = Bandsintown::Event.search({ :artists => [ 'mbid_3b39abeb-0064-4eed-9ddd-ee47a45c54cb', 'mbid_4e954b02-fae2-4bd7-9547-e055a6ac0527' ], :start_date => Time.now.beginning_of_month, :end_date => Time.now.end_of_month })
events = Bandsintown::Event.recommended({ :artists => ['Led Zeppelin'], :location => 'Boston, MA' })
events = Bandsintown::Event.daily
events = Bandsintown::Event.on_sale_soon({ :location => "Boston, MA", :radius => 10 })
venues = Bandsintown::Venue.search({ :query => "House of Blues", :location => "San Diego, CA" })
# 1700 => Bandsintown venue ID for Paradise Rock Club in Boston, MA venue = Bandsintown::Venue.new(1700) events = venue.events
# 1700 => Bandsintown venue ID for Paradise Rock Club in Boston, MA Bandsintown::Event.create({ :artists => [Bandsintown::Artist.new(:name => "The Roots")], :datetime => Time.parse("2010-06-01 20:00"), :venue => Bandsintown::Venue.new(1700), :ticket_url => "http://www.example.com/tickets/123", :ticket_price => 19.5, :on_sale_datetime => Time.parse("2010-05-01 12:00") })
# 1700 => Bandsintown venue ID for Paradise Rock Club in Boston, MA Bandsintown::Event.create({ :artists => ["Evidence", "Alchemist"], :datetime => "2010-06-01T19:30:00", :venue => { :name => "Paradise Rock Club", :city => "Boston", :region => "MA", :country => "United States" }, :ticket_url => "http://www.example.com/tickets/123", :ticket_price => 15, :on_sale_datetime => "2010-05-01T19:30:00" })
events = Bandsintown::Event.search(:location => "San Diego, CA") event = events.first event.cancel
artist = Bandsintown::Artist.new(:name => "Diamond District") events = artist.events event_id = events.first.bandsintown_id artist.cancel_event(event_id)
artist = Bandsintown::Artist.create({ :name => "A New Artist", :mbid => "abcd1234-abcd-1234-abcd-12345678abcd", :myspace_url => "http://www.myspace.com/anewartist", :website => "http://www.a-new-artist.com" })
artist = Bandsintown::Artist.create({ :name => "A New Artist" })
(The MIT License)
Copyright © 2009 Mike Costanza
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.
Changed the deprecated returning method to the tap method