Using Bandsintown API in Ruby on Rails

I am fairly new to Ruby on Rails and have done tutorials on making a
blogging app. For this web application that I am making, I am trying to
implement the Bandsintown api (
https://www.bandsintown.com/api/1.0/authentication) so users can see if
there are upcoming events for an artist they pick. Unfortunately, after
reading http://bandsintown.rubyforge.org/, I still do not understand how
to
do even the simplest methods. Any help would be appreciated.

  1. Where do I put " require ‘bandsintown’ "?

  2. I use

@venues = Bandsintown::Venue.search({
:query => “House of Blues”,
:location => “San Diego, CA”
})

in my controller and then

<%= @venues.inspect %>

in the corresponding view but that just shows nil.

Any help would be appreciated!

Hi

On Fri, Dec 18, 2015, at 07:54, Thanh T. wrote:

  1. Where do I put " require ‘bandsintown’ "?

you don’t, bundler will do that for you if you put ‘gem “bandsintown”’
in Gemfile (as how it should be done).

<%= @venues.inspect %>

in the corresponding view but that just shows nil.

I never used the gem but you probably need to set the app_id, for
example, in config/initializers:

config/initializers/bandsintown.rb

Bandsintown.app_id = ‘your_app_id’

On 17 December 2015 at 22:54, Thanh T. [email protected]
wrote:

I am fairly new to Ruby on Rails and have done tutorials on making a
blogging app. For this web application that I am making, I am trying to
implement the Bandsintown api
(https://www.bandsintown.com/api/1.0/authentication) so users can see if
there are upcoming events for an artist they pick. Unfortunately, after
reading http://bandsintown.rubyforge.org/, I still do not understand how to
do even the simplest methods. Any help would be appreciated.

Further to Nanya’s post I notice that the last release of this gem was
in 2010 for Rails 2.0. It may be worth trying but do not surprised if
it does not work with Rails 4

Colin

Thanh T. [email protected] writes:

<%= @venues.inspect %>

in the corresponding view but that just shows nil.

Of course, another possibility is that Bandsintown has no listings for a
House of Blues near San Diego.


Tamara T.
[email protected]
http://www.tamouse.org

Thanh T. [email protected] writes:

I am fairly new to Ruby on Rails and have done tutorials on making a
blogging app. For this web application that I am making, I am trying to
implement the Bandsintown api (
https://www.bandsintown.com/api/1.0/authentication) so users can see if
there are upcoming events for an artist they pick. Unfortunately, after
reading http://bandsintown.rubyforge.org/, I still do not understand how to
do even the simplest methods. Any help would be appreciated.

Before sticking an unknown API into a RoR application, I’m going to
suggest learning exactly how it works in a tiny application (just plain
old ruby) such as creating some tests with MiniTest, or even just poking
at it with Pry.

When you know just how it works, then putting it into a RoR app will be
lot easier. It’s just a lot harder to debug this sort of thing embedded
in the middle of all that other stuff going on.


Tamara T.
[email protected]
http://www.tamouse.org

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs