starting to add pwgen

This commit is contained in:
Paul Wilde 2023-10-27 11:37:07 +01:00
parent 0650f4c957
commit a97f3738b2
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,13 @@
# Package
version = "0.1.0"
author = "Paul Wilde"
description = "A new awesome nimble package"
license = "AGPL-3.0-or-later"
srcDir = "src"
bin = @["pw_generaturr"]
# Dependencies
requires "nim >= 2.0.0"

View file

@ -0,0 +1,17 @@
import ../../globurrl
import httpclient
import json
proc getPW() =
var c = newHttpClient()
try:
let resp = c.get("https://random-word-api.herokuapp.com/word?length=5")
if resp.status == $Http200:
echo resp.body.parseJson
except:
echo getCurrentExceptionMsg()
if isMainModule:
getPW()