Project

gwitch

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Gwitch can get switch games' info (including price) from nintendo official API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Gwitch

Gwitch can get switch games' info (including price) from Nintendo official API.

中文说明 | RubyGems

Prerequisites

  • ruby >= 2.3

Installation

gem install gwitch

Or you can install via Bundler if you are using Rails. Add this line to your application's Gemfile:

gem 'gwitch'

And then execute:

$ bundle

Basic Usage

Bash

Usage: gwitch [options]
    -g, --games                      Get all games (without price info)
    -p, --price alpha2,nsuid1,nsuid2 Get games' price (Max 50 nsuids)
    -c, --countries                  Get avaliable countries' alpha2 code
    -v, --version                    Print version and exit
    -h, --help                       Show help

The returned data will always be in json format.

Can be used with pipes and redirects.

eg.

gwitch -g >> games.json

Ruby

require 'gwitch'

Get all games.

games = Gwitch::Game.all

Get all avaliable countries.

countries = Gwitch::Country.all

Get country's info.

country = countries.first
country.alpha2     # => 'US'
country.region     # => 'Americas'
country.currency   # => 'USD'
country.avaliable? # => true

Query games' price (Max 50 games).

prices = Gwitch::Game.price('US', 'en', '70010000000141,70010000000142')

prices = Gwitch::Game.price('US', 'en', ['70010000000141', '70010000000142'])

prices = Gwitch::Game.price('US', 'en', [70010000000141, 70010000000142])

Build

git clone https://github.com/Dounx/gwitch
cd gwitch
gem build gwitch.gemspec
gem install --local gwitch-*.gem

Rake

List of available tasks

rake --tasks

License

Gwitch is an open-sourced software licensed under the MIT license.