No commit activity in last 3 years
No release in over 3 years
This is a simple API wrapper for Challonge 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

Challonge API for user

This gem is for educational use only. I have created this to have a practice on how to create an API wrapper for Rails and create it in a ruby gem.

Installation

Add this line to your application's Gemfile:

gem 'challonge_user_rails'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install challonge_user_rails

Usage

Get an API Token from Challonge site

Create an account on Challonge Website and get an API via Settings - Developer API.

Configure

Instance of the client must be done first before being able to use the API. You may check Rails docs to setup your API key via credentials.yml.

client = ChallongeUserRails::Client.new(api_key: [YOUR API KEY])

Get all Tournaments

client.tournaments

Get specific Tournament

Tournament URL is the URL parameter (not the address) of the tournament when you create it.

client.tournament(tournament_url)

Delete Tournament

client.delete_tournament(tournament_url)

Create Tournament

Challonge API expects a json data with attributes related to creation of a tournament. You may refer to their docs for an example json value.

client.create_tournament(data)

Get All Matches of a Tournament

client.matches(tournament_url)

Get a specific Tournament Match

client.match(tournament_url, match_id)

Sample Repository using this Gem

Check this repo to see how this gem is used.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/michael-dollosa/challonge_user_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the ChallongeUserRails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.