Skip to content

Instantly share code, notes, and snippets.

@nbardiuk
Last active November 28, 2020 19:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbardiuk/166dc6695bf55a351fa3070fd4065b8a to your computer and use it in GitHub Desktop.
Save nbardiuk/166dc6695bf55a351fa3070fd4065b8a to your computer and use it in GitHub Desktop.
Clojure shebang wtih arguments
#!/usr/bin/env -S clj -Sdeps '{:deps {clj-http/clj-http {:mvn/version "3.11.0"} cheshire/cheshire {:mvn/version "5.10.0"}}}'
(require '[clj-http.client :as http])
(require '[cheshire.core :as json])
(require '[clojure.pprint :refer [pprint]])
(let [url (or (first *command-line-args*) "https://httpbin.org/get?q=a")
{:keys [body headers]} (http/get url)]
(pprint headers)
(pprint (json/decode body)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment