13 lines
345 B
Hy
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)))))))
|