Open RoyalTS opened 11 years ago
+1
With tvdb_party I get a similar error. This is what fixed it for me there:
https://github.com/maddox/tvdb_party/issues/9
I would still like to get a proper solution though one day.
This issue still needs fixing
Same problem here when I try to search by id. Search by title always returns an empty array.
They both work fine for me after using tkrajacic's fix you should try it.
gem 'httparty', '=0.8.2'
My search by ID, and search by title is working fine now
@movies = ImdbParty::Imdb.new @results = @movies.find_by_title(params[:search_movie]).as_json
That did fix the search by id.
But when I try to search by title I still get nothing when I don't make anonymized requests:
imdb = ImdbParty::Imdb.new
imdb.find_by_title("The Dark Knight")
=> []
And get an error if I do anonymize:
imdb = ImdbParty::Imdb.new(anonymize: true)
imdb.find_by_title("The Dark Knight")
=> URI::InvalidComponentError: bad component(expected host component): anonymouse.org/cgi-bin/anon-www.cgi/app.imdb.com
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/generic.rb:604:in `check_host'
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/generic.rb:645:in `host='
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/generic.rb:194:in `initialize'
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/http.rb:84:in `initialize'
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/generic.rb:140:in `new'
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/generic.rb:140:in `build'
from /Users/Bastien/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/uri/http.rb:62:in `build'
from /Users/Bastien/Dev/pixs/vendor/bundle/gems/imdb_party-0.6.0/lib/imdb_party/imdb.rb:22:in `build_url'
from /Users/Bastien/Dev/pixs/vendor/bundle/gems/imdb_party-0.6.0/lib/imdb_party/imdb.rb:32:in `find_by_title'
from (irb):5
from /Users/Bastien/Dev/pixs/vendor/bundle/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
from /Users/Bastien/Dev/pixs/vendor/bundle/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /Users/Bastien/Dev/pixs/vendor/bundle/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Do you have
gem 'jeweler'
gem 'shoulda'
Beacause without Anonymize it works fine for me.
irb(main):001:0> imdb = ImdbParty::Imdb.new
=> #<ImdbParty::Imdb:0x5790db0>
irb(main):002:0> imdb.find_by_title("The Dark Knight")
{"title_popular"=>[{"id"=>"tt0468569", "title"=>"The Dark Knight", "name"=>"", "
title_description"=>"2008, <a href='/name/nm0634240/'>Christopher Nolan</a>"
, "episode_title"=>"", "description"=>"2008, <a href='/name/nm0634240/'>Chri...
jeweler
and shoulda
are only dependencies if you want to work on this library, or run the tests. It shouldn't have any effect on the actual api calls.
For the sake of trying I added them to my Gemfile, but it din't have any effect.
I noticed that you were running it from irb
, so I tried to run it outside of my app, and that worked. Maybe a conflict with another gem I'm using. I'll have to investigate.
For refence, here's what my Gemfile looks like:
source "https://rubygems.org"
ruby "1.9.3"
gem 'rails', '3.2.13'
gem 'json'
gem 'nokogiri'
gem 'jquery-rails'
gem 'httparty', '=0.8.2'
gem 'imdb_party', '0.6.0'
gem 'omniauth', '1.1.3'
gem 'omniauth-facebook'
gem 'simple_form'
gem 'fastercsv'
group :production do
gem 'unicorn'
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
gem 'factory_girl_rails'
gem 'wirble'
gem 'rails3-generators'
gem 'rspec-rails', '~> 2.12.0'
gem 'debugger', '~> 1.4', require: false, platforms: :ruby_19
gem 'taps'
end
group :test do
gem 'rb-fsevent', :require => false
gem 'guard'
gem 'guard-rspec'
gem 'shoulda'
gem 'rr'
gem 'timecop'
end
I just tried out the gem and it doesn't seem to work at all. Here's what I get when I run the example from the readme:
What am I doing wrong?