Skip to content

Commit

Permalink
now allow spaces in search
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffStahler committed Feb 26, 2012
1 parent 83da621 commit c091023
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Songkick
API_KEY = 'UokXlLzqCN1zhOWe'
ROOT_URL = 'http://api.songkick.com/api/3.0/'
def self.get_loc_id(city)
city = URI.escape(city)
url = "#{ROOT_URL}search/locations.json?query=#{city}&apikey=#{API_KEY}"
parsed_json_response = JSON.parse(RestClient.get(url))
loc_id = parsed_json_response['resultsPage']['results']['location'][0]['metroArea']['id']
Expand Down
1 change: 1 addition & 0 deletions env.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'sinatra'
require 'rest_client'
require 'json'
require 'uri'

require './app'

0 comments on commit c091023

Please sign in to comment.