Git Product home page Git Product logo

codewars.api's Introduction

Codewars.API

Codewars.API is a .NET wrapper for the codewars.com REST API. It facilitates easy access to the codewars API with static typing, async programming models, and full xdoc as documented on their site. It lets you do all kinds of interesting things like searching for businesses, getting user comments and ratings, and handling common errors. The library is written C#, and is available on NuGet.

For more information, visit the codewars REST API

Installing

In most cases, you're going to want to install the Codewars.API NuGet package. Open up the Package Manager Console in Visual Studio, and run this command:

PM> Install-Package Codewars.API

How to Use

The source includes a few examples that should help you get started with ASP.NET.

Handling Tokens

The CodewarsClient constructor takes an API key which can be found on the account settings page (https://www.codewars.com/users/edit). Keep this keys safe! You can put them in the applicationSettings portion of your web.config (recommended), or store them in an environment variable on your dev machine:

var client = new CodewarsClient("My API Key");
var response = client.GetUser("jacerhea");

Using the Search API

Codewars.API uses the ASP.NET Web API client(TPL) to make managing asynchronous requests easier.

var task = y.Search("coffee", "seattle, wa").ContinueWith((searchResults) =>
{
    foreach (var business in searchResults.Result.businesses)
    {
        Console.WriteLine(business.name);
    }
});

There are a lot of other ways to search. For more info, the best place to look is the integration tests.

Building the Source

If you want to build the source, clone the repository, and open up Codewars.API.sln.

git clone https://github.com/jacerhea/Codewars.API.git
explorer src\Codewars.API.sln

Supported Platforms

Codewars.API targets .NET 4.5. If you would like support for other platforms, let me know.

License

MIT License

Questions?

Feel free to submit an issue on the repository, or find me at @jacerhea

codewars.api's People

Contributors

jacerhea avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.