Giter VIP home page Giter VIP logo

ex_clash's Introduction

ExClash

ExClash is an Elixir library for working with Supercell's Clash of Clans API.

Docs

Disclaimer

This material is unofficial and is not endorsed by Supercell. For more information see Supercell's Fan Content Policy.

Installation

The package can be installed by adding ex_clash to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_clash, "~> 1.0"}
  ]
end

Dependencies

  • HTTP requests are made using Req.
  • Due to the aforementioned dependency, this library requires the use of at least Elixir v1.12 or newer. At time of building, Elixir v1.16 was used.
  • A developer account at https://developer.clashofclans.com/ is required so you can acquire An API Token for authorized use of Supercell's API.

Features

  • Add your token to any [ENV].secret.exs and start using this library.
    config :ex_clash, token: "YOUR SUPER SECRET TOKEN"
  • Get well-defined structs back from responses instead of parsing maps with string keys.
  • HTTP functions are available to make your own API requests. Just use ExClash.HTTP.get/2 which will handle auth, the url, and query params for you.
  • Not sure if feature; this library is not going to tell you if you got a parameter wrong in your Keyword list. It'll just forward it along to Req to consume, who will just attach it as a query param and Supercell's API will ignore it. ๐Ÿคท

Usage

TODO: Provide copious examples of usage of this library.

Supercell's Clash of Clans API

Endpoints with โœ… have been implemented. All requests are GET requests except for the one that is labelled "POST."

Clan specific information

  • โœ… /clans
  • โœ… /clans/{clanTag}
  • /clans/{clanTag}/capitalraidseasons
  • /clans/{clanTag}/members
  • /clans/{clanTag}/warlog
  • /clans/{clanTag}/currentwar
  • /clans/{clanTag}/currentwar/leaguegroup
  • /clanwarleagues/wars/{warTag}

Player specific information

  • /players/{playerTag}
  • /players/{playerTag}/verifytoken (POST)

League information

  • /capitalleagues
  • /capitalleagues/{leagueId}
  • /leagues
  • /leagues/{leagueId}
  • /leagues/{leagueId}/seasons
  • /leagues/{leagueId}/seasons/{seasonId}
  • /builderbaseleagues
  • /builderbaseleagues/{leagueId}
  • /warleagues
  • /warleagues/{leagueId}

Rankings

  • /locations
  • /locations/{locationId}
  • /locations/{locationId}/rankings/clans
  • /locations/{locationId}/rankings/players
  • /locations/{locationId}/rankings/players-builder-base
  • /locations/{locationId}/rankings/clans-builder-base
  • /locations/{locationId}/rankings/capitals

Gold Pass

  • /goldpass/seasons/current

Esports related APIs

Currently, Supercell does not have any Esports related API endpoints. I'm including this category here because they have the category in their developer portal.

Labels

  • /labels/players
  • /labels/clans

ex_clash's People

Contributors

kettelbear 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.