foxhole/app/hyap.hy
SouthFox ce4ab247e7
All checks were successful
/ run-pytest (push) Successful in 1m1s
[refactor] use let define variables
2024-02-27 00:34:40 +08:00

13 lines
345 B
Hy

#!/usr/bin/env hy
(import httpx)
(import loguru [logger])
(import app [config])
(defn/a fetch
[url]
(.info logger url)
(return (.json
(with/a [client (.AsyncClient httpx)]
(let [headers {"User-Agent" config.USER_AGENT
"Accept" config.AP_CONTENT_TYPE}]
(await (.get client url :headers headers)))))))