Project

intown

0.0
No commit activity in last 3 years
No release in over 3 years
A client for the Bandsintown API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 2.12.0
~> 2.4.0
~> 1.9.3

Runtime

>= 1.2.0
~> 0.10.0
 Project Readme

Intown

A gem to consume the Bandsintown 2.0 API. Supports finding artists by name, MusicBrainz ID, & Facebook Page Id. Supports returning events by artist & optional date range.

Installation

Add this line to your application's Gemfile:

gem 'intown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install intown

Usage

Set your "app_id" configuration before making any calls. In a Rails app, this would go in config/initializers/intown.rb.

Intown.configure do |config|
  config.app_id = <YOUR APP ID HERE>
end

Fetching an artist

Intown::Artist.fetch(params)

Params should be one of the following:

{:name => "Radiohead"}
{:mbid => "<band's MusicBrainz ID>"}
{:fbid => "<band's Facebook page ID>"}

Returns an object that responds to the API attributes in the Bandsintown API documentation

Returns nil if the band cannot be found.

Fetching events for an artist

Intown::Event.list(params)

Params should identify the artist to search for (see above). Params may also include one of the following date options:

{:upcoming => true}        # default: only returns future events
{:all => true}             # returns all events for this artist
{:date => 3.days.from_now} # returns all events on the specified date
{:from => 3.days.ago, :to => 5.days.from_now } # returns all events in the date range (inclusive)

Returns an object that responds to the API attributes in the Bandsintown API documentation

Returns nil if the band does not exist.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Write Tests
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

License

This code is provided under the MIT license. See LICENSE.txt for more details.