https://github.com/lambda-fairy/nationstates
:earth_americas: NationStates API client for Haskell
https://github.com/lambda-fairy/nationstates
Last synced: 7 months ago
JSON representation
:earth_americas: NationStates API client for Haskell
- Host: GitHub
- URL: https://github.com/lambda-fairy/nationstates
- Owner: lambda-fairy
- License: apache-2.0
- Created: 2015-06-18T03:21:59.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-13T05:23:01.000Z (over 10 years ago)
- Last Synced: 2026-01-14T06:53:36.780Z (7 months ago)
- Language: Haskell
- Homepage: https://lambda.xyz/nationstates/
- Size: 122 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NationStates for Haskell [](https://travis-ci.org/lfairy/nationstates)
[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.
[NationStates]: https://nationstates.net
[official API]: https://www.nationstates.net/pages/api.html
## 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.
[tls]: https://hackage.haskell.org/package/tls
## Dependencies
* GHC 7.6 or newer
## Installation
`nationstates` is hosted on [Hackage].
cabal install nationstates
[Hackage]: https://hackage.haskell.org/package/nationstates
## Example
```haskell
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
```