Nintendo eShop
Description
When I want to check the price of a game on the Nintendo eShop I want to search Nintendo's API by external key so that I am confident I am getting the correct price.
Installation
Add this line to your application's Gemfile:
gem 'nintendo_eshop'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nintendo_eshop
Usage
Use the provided base_url
, api_key
and app_id
. These are provided as configuration in case the values change. The README will be updated to reflect the new values so that you do not have to update the library.
NintendoEshop.base_url = "https://u3b6gr4ua3-dsn.algolia.net"
NintendoEshop.api_key = "9a20c93440cf63cf1a7008d75f7438bf"
NintendoEshop.app_id = "U3B6GR4UA3"
Retrieve a game by ID (nsuid)
game = NintendoEshop::Game.retrieve_by(id: "70010000001130")
game.art
game.categories
game.current_price
game.description
game.esrb
game.id
game.msrp
game.object_id
game.platform
game.release_date
game.release_date_pretty
game.sale_percent
game.sale_price
game.title
game.url
Or a game on sale
game = NintendoEshop::Game.retrieve_by(id: "70010000001539")
game.art
game.categories
game.current_price
game.description
game.esrb
game.id
game.msrp
game.object_id
game.platform
game.release_date
game.release_date_pretty
game.sale_percent
game.sale_price
game.title
game.url
Or by object_id
game = NintendoEshop::Game.retrieve_by(object_id: "26851cb3-4f10-333a-8d7c-f9cae4a9bc03")
Search by Title
games = NintendoEshop::GamesList.by_title("Super Mario Odyssey")
games.first.title
Errors
Error handling is still a work in progress
game = NintendoEshop::Game.retrieve_by(id: "invalid id")
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/rickpeyton/nintendo_eshop.
License
The gem is available as open source under the terms of the MIT License.
Releases
CircleCi is used to push releases to rubygems.org
To release
- Edit the version.rb file
bundle
- Commit that to your master branch
- Create and push a git tag with the same name as your version
Example
git tag -m "Release 0.1.0" 0.1.0
git push origin 0.1.0