Closed bhardin closed 9 years ago
Can you open the inventory of that user when using the website (when not being logged in)?
This helped. However, problem is still unsolved.
require 'steam-condenser'
require 'steam/community/game_inventory'
id = SteamId.new(USERNAME)
WebApi.api_key = SUPER_PRIVATE_KEY
inventory = Dota2Inventory.new(id.steam_id64)
returns:
NoMethodError: undefined method `new' for GameItem:Module
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/game_inventory.rb:138:in `block in fetch'
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/game_inventory.rb:136:in `each'
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/game_inventory.rb:136:in `fetch'
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/cacheable.rb:42:in `block in method_added'
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/cacheable.rb:105:in `new'
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/game_inventory.rb:90:in `call'
from /Users/bhardin/.rvm/gems/ruby-2.1.5/gems/steam-condenser-1.3.9/lib/steam/community/game_inventory.rb:90:in `new'
from (irb):15
from /Users/bhardin/.rvm/rubies/ruby-2.1.5/bin/irb:11:in `<main>'
I'm pretty sure this is the line that is broken:
Ok, this seems indeed like a bug.
I wonder why Dota2Inventory
doesn't pick up Dota2Item
as its item class (defined here: https://github.com/koraktor/steam-condenser-ruby/blob/1.3-stable/lib/steam/community/dota2/dota2_inventory.rb#L28).
Nevertheless, GameItem
has to be a class (instead of a module) so other games (without specific implementations) work too.
I have some of it working locally by using a mashup of your code and my own. Don't fully grok the code or else I'd submit a PR.
This was fixed in the commits above. If you can't use the development version and don't want to wait for a new release, you can also fix this by requiring steam/community/dota2/dota2_inventory
directly.
Thanks for this. Looks great!
I would assume a
WebApi.api_key
is necessary since I get 403 without one.However, once I set my key, I receive the following:
Any help?