Skip to content

Commit

Permalink
Merge pull request jayfajardo#1 from ewlarson/master
Browse files Browse the repository at this point in the history
Add type to view.find call
  • Loading branch information
jayfajardo committed Feb 11, 2012
2 parents 891036d + 3399d73 commit 308d0df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/openlibrary/view.rb
Expand Up @@ -23,8 +23,8 @@ def self.find_by_olid(key)
find("OLID",key)
end

def self.find(key)
response = RestClient.get "http://openlibrary.org/api/books?bibkeys=ISBN:#{key}&format=json&jscmd=viewapi"
def self.find(type,key)
response = RestClient.get "http://openlibrary.org/api/books?bibkeys=#{type}:#{key}&format=json&jscmd=viewapi"

response_data = JSON.parse(response)
view = response_data["#{type}:#{key}"]
Expand Down

0 comments on commit 308d0df

Please sign in to comment.