From 0de298f0759c7f0ff0ac61c683df97e19da42a6d Mon Sep 17 00:00:00 2001 From: oreodave Date: Thu, 26 Sep 2019 08:54:26 +0100 Subject: +feature to download json and parse it in emacs Restclient doesn't seem to work anymore (at least for my ASP.NET API), thus making this thing to do gets quickly --- doom.d/config.org | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doom.d') diff --git a/doom.d/config.org b/doom.d/config.org index 86a8453..43d8cd0 100644 --- a/doom.d/config.org +++ b/doom.d/config.org @@ -139,6 +139,24 @@ My docsets are stored in .docsets for ease of use (interactive) (wttrin (shell-command-to-string "pass location")))) #+END_SRC +*** Download JSON +#+BEGIN_SRC emacs-lisp +(defun oreodave/request-json-fn (url) + (set-process-sentinel + (start-process-shell-command "request-json" "*request-json*" (format "curl %s" url)) + (lambda (process event) + (when (memq (process-status process) '(exit stop)) + (message "Request finished") + (with-current-buffer "*request-json*" + (json-mode) + (json-mode-beautify)))))) + + +(defun oreodave/request-json () + (interactive) + (oreodave/request-json-fn (read-string "Enter url: ")) + ) +#+END_SRC *** Themes #+BEGIN_SRC emacs-lisp (setq oreodave/aesthetics/list '(doom-molokai doom-peacock doom-solarized-dark)) -- cgit v1.2.3-13-gbd6f