0.0
No release in over a year
Ruby client for the new CHGK rating API (api.rating.chgk.net).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.5
~> 3.10
~> 13.0
~> 3.6
~> 1.6
~> 0.22
~> 6.0
~> 3.14

Runtime

 Project Readme

RatingChgkV2

Gem CI Coverage Status Downloads total Maintainability

Ruby client for competitive "What? Where? When?" (aka "CHGK") API. This gem is a replacement for ChgkRating which worked only with the deprecated API version.

Installation and requirements

This gem requires Ruby 2.7+. Install it by running:

$ gem install rating-chgk-v2

Include it in your script:

require 'rating_chgk_v2'

Client initialization

Initialize an API client:

@client = RatingChgkV2.client

Optionally, provide your JWT token and connection options (please note that JWT is not required to access most of the endpoints):

@client = RatingChgkV2.client token: 'MY_JWT', params: {open_timeout: 100, timeout: 500}

Now use client to perform API requests:

teams = @client.teams itemsPerPage: 2, name: 'Н', page: 3

Usage

Please find documentation at our Wiki.

Running tests

Tests are written in RSpec (all HTTP requests are stubbed):

rspec .

Observe test results and coverage.

Copyright and license

Licensed under the MIT license.

Copyright (c) 2023 Ilya Bodrov-Krukowski