Skip to content

Instantly share code, notes, and snippets.

@bhyde
Created November 23, 2013 16:37
Show Gist options
  • Save bhyde/7616778 to your computer and use it in GitHub Desktop.
Save bhyde/7616778 to your computer and use it in GitHub Desktop.
Some one liners in service of making a list of etherpad-lite plugins. See: https://github.com/ether/etherpad-lite/wiki/Plugin,-a-list
(in-package #:cl-user)
;;; run each form in here one at a time by hand.
(ql:quickload '("cl-json" "drakma"))
(defparameter *all* ;; This takes quite a while.
(cl-json:decode-json-from-source
(drakma:http-request "https://registry.npmjs.org/-/all" :want-stream t)))
(defparameter *ep* ;; pluck out just the etherpad plugins, sort them.
(sort
(loop for d in (rest *all*)
as name = (cdr (assoc :name (rest d)))
when (eq 0 (search "ep_" name))
collect d)
#'string<
:key #'(lambda (x) (cdr (assoc :name (rest x))))))
(defun dump-one (name)
(let ((info (rest (assoc name *ep*))))
(flet ((p (n) (rest (assoc n info))))
(cond
((p :repository)
(format t "~&* __[~A](~A)__ ~A"
(p :name)
(rest (assoc :url (p :repository)))
(p :description)))
(t
(format t "~&* __~A__ ~A" (p :name) (p :description)))))))
;; example:
;; (dump-one :ep--authorship--export)
;; (dump-one :ep--show--whitespace)
(loop for (n) in *ep* do (dump-one n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment