midterm submission

Query jambase api and report back on the next matching show.  Example:

bmath@xojito$ ./jamcli.rb
use directives to specify zip code and
artist id.  Type run to execute query.


e.g. > artist 1977 zip 10010
     > run

[]> artist 1977 zip 10010
["artist", "1977", "zip", "10010"]! run
{"artist"=>"1977", "zip"=>"10010"}
No shows found.
[]? quit


I only get 50 api calls per day, so I needed a cache for testing. In the 
future, I'd probably use a similar mechanism (with another level of 
hierarchy for band id, and a timestamp to see if it's stale).  It was 
pretty fun to get that generic data saving functionality to work.

On 07/16/2014 08:04 PM, Michael Wenger wrote:
>
> In _Brian_Matheson/midterm/jambase.rb:
>
> > +
> > +  def initialize(url)
> > +    if self.read('jambase.dat')
> > +      if @url == url
> > +        return true
> > +      else
> > +        @url = url
> > +        fetch_data_from_jambase
> > +      end
> > +    end
> > +  end
> > +
> > +  def fetch_data_from_jambase
> > +    require 'rest-client'
> > +    @data = JSON.load(RestClient.get(@url))
> > +    self.write('jambase.dat')
>
> Interesting that you persist this to a dat file vs store in an 
> instance variable. Out of curiosity what drove that decision??
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/ga-students/bewd_11_nyc_homework/pull/28/files#r15035530>.
>