codeforces-cli-0.1.0: Command line interface to interact with Codeforces.
Safe HaskellNone
LanguageHaskell2010

Codeforces.Config

Synopsis

Documentation

data UserConfig Source #

Represents the user's configuration settings.

The API key must first be generated on the Codeforces API page. An API key consists of two parameters: key and secret.

To use the API key in a request, some parameters need to be generated from this configuration.

Constructors

UserConfig 

Fields

data AuthQuery Source #

Contains the data needed to make an authorized GET request. See generateRequestParams.

generateRequestParams :: UserConfig -> String -> Query -> IO Query Source #

generateRequestParams config path query returns a query string with extra query items that are generated to allow for authorized access.

The parameters are of the form: ?paramI=valueI&apiKey=key&time=time&apiSig=randhash

Where

  • rand is a random 6-digit integer
  • time is current time since epoch in seconds
  • hash is the SHA-512 hashcode of the UTF-8 encoded string:
rand/methodName?paramI=valueI&apiKey=key&time=time#secret