RoxasShadow / Smogon

Wrapper around the Smogon APIs to get (Poké|Ability|Item|Move|Moveset)dex data from their database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not execute example on readme

mql21 opened this issue · comments

I created a test.rb file at the root of the cloned project with code provided in the readme:

require 'smogon'

puts Smogon::Pokedex.get    'Blaziken'
puts Smogon::Abilitydex.get 'Synchronize'
puts Smogon::Itemdex.get    'Leftovers'
puts Smogon::Movedex.get    'Extreme Speed'
puts Smogon::Movesetdex.get 'Abomasnow', 'UU', 'bw' 

but I'm getting the following error when I execute it:

/usr/lib/ruby/2.3.0/open-uri.rb:359:in open_http': 404 Not Found (OpenURI::HTTPError) from /usr/lib/ruby/2.3.0/open-uri.rb:737:in buffer_open'
from /usr/lib/ruby/2.3.0/open-uri.rb:212:in block in open_loop' from /usr/lib/ruby/2.3.0/open-uri.rb:210:in catch'
from /usr/lib/ruby/2.3.0/open-uri.rb:210:in open_loop' from /usr/lib/ruby/2.3.0/open-uri.rb:151:in open_uri'
from /usr/lib/ruby/2.3.0/open-uri.rb:717:in open' from /usr/lib/ruby/2.3.0/open-uri.rb:35:in open'
from /var/lib/gems/2.3.0/gems/smogon-0.6.2/lib/smogon/api.rb:34:in request' from /var/lib/gems/2.3.0/gems/smogon-0.6.2/lib/smogon/pokedex.rb:37:in get'
from pokemon.rb:4:in `

'

I have previously installed the gem but I can't seem to get it to work. Is this lib still working? Or am I doing something wrong?

Cheers.

commented

Hi @miquelp,

I just run the tests and they failed reporting the same errors that you had. Checking the website, it looks like they replaced their HTTP APIs with new ones that are RPC-based.

We need to somehow implement them in this gem to make it work again.


I started to work on it, I'll keep you updated.

commented

4959fc8

Let me know if something is still not working for you.

It is now working like charm. Thanks for the fix.