Created
May 21, 2020 23:18
-
-
Save devth/bd154e76536eed783974764dc6e6a2d3 to your computer and use it in GitHub Desktop.
Revisions
-
devth created this gist
May 21, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ (defn xkcd-cmd "xkcd # fetch current xkcd comic" {:yb/cat #{:fun :img}} [_] ((juxt :title :img :alt) (get-json endpoint))) (defn xkcd-idx-cmd "xkcd <index> # fetch xkcd number <index>" {:yb/cat #{:fun :img}} [{index :match}] ;; TODO fetch https://xkcd.com/<index>/info.0.json ) (cmd-hook #"xkcd" #"\d+" xkcd-idx-cmd _ xkcd-cmd)