Skip to content

Commit

Permalink
removed Jammed::Search
Browse files Browse the repository at this point in the history
  • Loading branch information
seanslerner committed Apr 25, 2012
1 parent 5612bd6 commit aefdb6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 1 addition & 7 deletions lib/jammed.rb
Expand Up @@ -4,13 +4,7 @@
require file
end

module Jammed

class Search #:nodoc:
include HTTParty
base_uri 'http://api.thisismyjam.com/1'
end

module Jammed
class << self
#Creates a Jammed::Base object for interacting with the API
#
Expand Down
8 changes: 5 additions & 3 deletions lib/jammed/people_search.rb
Expand Up @@ -48,9 +48,11 @@ def self.search_artist(artist, api_key)
#
# Jammed::PeopleSearch.search_track('beach boys', 'good vibrations', '08972935872035')
def self.search_track(artist, track, api_key)
uri = URI.escape("/search/person.json?by=track&q=#{artist.split.join('+')}|#{track.split.join('+')}&key=#{api_key}", '|')
search = Search.get uri
search["people"][0] ? search["people"] : "No tracks found"
response = request(:get, "/search/person.json",
:query => {:by => 'track',
:q => "#{artist.split.join('+')}|#{track.split.join('+')}",
:key => api_key})
JSON.parse(response.body)['people']
end

end
Expand Down

0 comments on commit aefdb6f

Please sign in to comment.