Skip to content

Instantly share code, notes, and snippets.

@b10n1k
Created October 18, 2022 19:42
Show Gist options
  • Save b10n1k/23f3b0907748f8d6add957436f8d290d to your computer and use it in GitHub Desktop.
Save b10n1k/23f3b0907748f8d6add957436f8d290d to your computer and use it in GitHub Desktop.
;; 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)
@b10n1k
Copy link
Author

b10n1k commented Oct 18, 2022

Wrong type argument: stringp, 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment