lib/filmbuff/imdb.rb in filmbuff-0.1.2 vs lib/filmbuff/imdb.rb in filmbuff-0.1.5
- old
+ new
@@ -2,11 +2,11 @@
class IMDb
attr_accessor :locale
include HTTParty
include HTTParty::Icebox
- cache :store => 'file', :timeout => 120, :location => Dir.tmpdir
+ cache :store => 'memory', :timeout => 120
base_uri 'app.imdb.com'
default_params = {
"api" => "v1",
"app_id" => "iphone1_1",
@@ -19,17 +19,17 @@
end
public
def find_by_id(imdb_id)
result = self.class.get('/title/maindetails', :query => {
- tconst: imdb_id, locale: @locale
+ :tconst => imdb_id, :locale => @locale
}).parsed_response
Title.new(result["data"])
end
def find_by_title(title)
results = self.class.get('/find', :query => {
- q: title, locale: @locale
+ :q => title, :locale => @locale
}).parsed_response
find_by_id(results["data"]["results"][0]["list"][0]["tconst"])
end
end
end