Created
March 3, 2019 21:14
-
-
Save lillypad/3345cfc1821fe2e8c75ccb92928d69f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(load "~/quicklisp/setup.lisp") | |
(ql:quickload :drakma :silent t) | |
(ql:quickload :cl-json :silent t) | |
(defmacro drakma-http-request (url &rest body) | |
`(map 'string 'code-char (drakma:http-request, url ,@body))) | |
(defun get-public-ip() | |
(cdr (assoc :ip | |
(json:decode-json-from-string | |
(drakma-http-request "http://ipinfo.io" | |
:user-agent "curl"))))) | |
(defun main() | |
(format t "~a~%" (get-public-ip))) | |
(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment