Created
October 18, 2022 19:42
-
-
Save b10n1k/23f3b0907748f8d6add957436f8d290d 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
;; This buffer is for text that is not saved, and for Lisp evaluation. | |
;; To create a file, visit it with <f20> and enter text in its buffer. | |
(require 'dash) | |
(require 's) | |
;;(require 'yaml-mode) | |
(require 'tramp) | |
(require 'subr-x) | |
(require 'eshell) | |
(require 'dired) | |
(cl-defun get-nth-opensuse-build (n &optional (v 1)) | |
(let* ((json-hash (with-current-buffer | |
(url-retrieve-synchronously (format "https://openqa.opensuse.org/group_overview/%s.json" v)) | |
(goto-char (point-min)) | |
(re-search-forward "^$") | |
(delete-region (point) (point-min)) | |
(json-parse-buffer))) | |
(builds (gethash "build_results" json-hash)) | |
(last-build (aref builds n))) | |
(message "%S" last-build) | |
(list nil | |
(vector | |
(gethash "version" last-build) | |
(number-to-string (gethash "total" last-build)) | |
(number-to-string (gethash "passed" last-build)) | |
(number-to-string (gethash "failed" last-build)) | |
(number-to-string (gethash "unfinished" last-build)))))) | |
(trace-function 'get-nth-opensuse-build 0) | |
(get-nth-opensuse-build 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wrong type argument: stringp, 0