项目作者: overtools

项目描述 :
An easy-to-use library for interacting with the Overwatch League web API
高级语言: C#
项目地址: git://github.com/overtools/OWLeagueLib.git
创建时间: 2018-01-09T00:32:44Z
项目社区:https://github.com/overtools/OWLeagueLib

开源协议:MIT License

下载


OWLeagueLib - a library for interacting with the Overwatch League web API

License: MIT

Build status

Providers:

There are currently two data providers that you can switch out based on your needs. One for async, and one for synchronous code.

  1. OWLApiDataProvider
  2. OWLAsyncApiDataProvider

Usage:

Basic

  1. // Create the provider
  2. OWLApiDataProvider provider = new OWLApiDataProvider();
  3. // Get the data that you need, in a nice deserialised object.
  4. ScheduleResponse scheduleResponse = provider.FetchSchedule();

Getting next match (using async)

  1. // create provider
  2. OWLAsyncApiDataProvider asyncProvider = new OWLAsyncApiDataProvider();
  3. // get schedule object
  4. ScheduleResponse schedule = await asyncProvider.FetchSchedule();
  5. // get the stage using the name, index/id can also be used
  6. Stage stage = schedule.GetStage("Stage 1");
  7. // get the next match in this stage
  8. StageMatch nextMatch = stage.GetNextMatch();
  9. Console.Out.WriteLine($"Next match is: {nextMatch.Team1.Name} vs {nextMatch.Team2.Name} at {nextMatch.StartDateTimeOffset()}");

Getting next stage (using async, you can combine this with “Getting next match” if you want)

  1. // create provider
  2. OWLAsyncApiDataProvider asyncProvider = new OWLAsyncApiDataProvider();
  3. // get schedule object
  4. ScheduleResponse schedule = await asyncProvider.FetchSchedule();
  5. // get next stage
  6. Stage stage = schedule.GetNextStage();
  7. Console.Out.WriteLine($"The next stage of the current OWL season is: {stage.Name}");

Requirements

  • RestSharp

Changelog

  • 09-Jan-2018: First release.

Future

  • Locale support.
  • Pagination support.