Github fetcher: use json.el for backward-compatibility sake

This commit is contained in:
Félix Baylac-Jacqué 2022-04-07 12:17:40 +02:00
parent 09c5099488
commit 6bc5b53fb2
No known key found for this signature in database
GPG key ID: EFD315F31848DBA4

7
h.el
View file

@ -28,6 +28,7 @@
;;; Code:
(require 'json)
;; Required to batch eval the module: the substring functions are
;; loaded by default in interactive emacs, not in batch-mode emacs.
(eval-when-compile (require 'subr-x))
@ -76,9 +77,9 @@ Errors out if we can't find it."
Parsing a response from a GET https://api.github.com/repos/user/repo request."
(progn (set-buffer response-buffer)
(goto-char 0)
(let* ((parsed-buffer (json-parse-buffer))
(ssh-url (gethash "ssh_url" parsed-buffer))
(https-url (gethash "clone_url" parsed-buffer)))
(let* ((parsed-buffer (json-read))
(ssh-url (cdr(assoc 'ssh_url parsed-buffer)))
(https-url (cdr(assoc 'clone_url parsed-buffer))))
`((ssh . ,ssh-url) (https . ,https-url)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;