Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ire4ever1190/nim-opentmdb
api wrapper over Open Trivia Database written in nim
https://github.com/ire4ever1190/nim-opentmdb
Last synced: 11 days ago
JSON representation
api wrapper over Open Trivia Database written in nim
- Host: GitHub
- URL: https://github.com/ire4ever1190/nim-opentmdb
- Owner: ire4ever1190
- License: mit
- Created: 2020-08-14T12:42:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-04T03:08:29.000Z (about 1 year ago)
- Last Synced: 2024-05-02T02:34:37.259Z (6 months ago)
- Language: Nim
- Size: 403 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
This is a simple sync/async wrapper around [The Open Trivia Database](https://opentdb.com) which is an api to get trivia questions from a variety of categories in multiple choice or true/false fashion
[Docs available here](https://ire4ever1190.github.io/nim-opentmdb/opentdb.html)
install through nimble
```
nimble install opentdb
```### Example
```nim
import opentrivadblet client = newHttpClient()
echo client.getQuestions() # Gets 10 questions and prints them outlet asyncClient = newAsyncHttpClient()
let questions = waitFor client.getQuestions()
for question in questions:
echo question.question
```make sure to enable ssl when running