nationstates: NationStates API client

[ apache, library, network, web ] [ Propose Tags ] [ Report a vulnerability ]

NationStates API client


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.3.0.0, 0.3.0.1, 0.4.0.0, 0.5.0.0 (info)
Dependencies base (>=4.6 && <5), bytestring, clock, containers, http-client, http-client-tls, http-types, multiset, tls (>=1.3.3), transformers, xml [details]
License Apache-2.0
Copyright 2015 Chris Wong
Author Chris Wong
Maintainer lambda.fairy@gmail.com
Category Network, Web
Home page https://github.com/lfairy/nationstates
Source repo head: git clone https://github.com/lfairy/nationstates.git
Uploaded by ChrisWong at 2015-10-29T05:38:58Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 7696 total (16 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-10-30 [all 1 reports]

Readme for nationstates-0.5.0.0

[back to package description]

NationStates for Haskell Build Status

NationStates is an online government simulation game, created by Max Barry. The site generates a wealth of data, some of which can be accessed through its official API.

This library lets you query this API using the Haskell programming language.

Features

  • Type safe: you can't refer to a shard unless you explicitly request it.

  • Automatic rate limiting, which can be disabled or overridden if you want.

  • HTTPS support via the tls library.

  • Free and open source under the Apache License, version 2.0.

Dependencies

  • GHC 7.6 or newer

Installation

nationstates is hosted on Hackage.

cabal install nationstates

Example

import NationStates
import qualified NationStates.Nation as Nation
import Text.Printf

main = do
    c <- newContext "ExampleBot/2000"
    (name, motto) <- Nation.run "Montesardo-East Adanzi" shards c
    printf "%s has the motto: %s\n" name motto
  where
    shards = (,) <$> Nation.name <*> Nation.motto