summaryrefslogtreecommitdiff
path: root/src/gizmo/wasp-wikipedia.el
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-05-01 17:06:41 -0400
committerLLLL Colonq <llll@colonq>2025-05-01 17:06:41 -0400
commitfb01362a9dd816fc0d0e50052ab4764dd30e46f3 (patch)
treed581df21e161a0483d8b02ea4519debb4501a4a7 /src/gizmo/wasp-wikipedia.el
parentb21ecce6645fc17c520b722de3d96e550c77c490 (diff)
You know we love updating with a horrendous commit message
Diffstat (limited to 'src/gizmo/wasp-wikipedia.el')
-rw-r--r--src/gizmo/wasp-wikipedia.el34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gizmo/wasp-wikipedia.el b/src/gizmo/wasp-wikipedia.el
index af69de07..74a6adf0 100644
--- a/src/gizmo/wasp-wikipedia.el
+++ b/src/gizmo/wasp-wikipedia.el
@@ -29,18 +29,18 @@ Pass the resulting article summary to K."
:parser #'json-parse-buffer
:success
(cl-function
- (lambda (&key data &allow-other-keys)
+ (lambda (&key data &allow-other-keys)
- (setq w/wikipedia-last-response data)
- (if-let (((ht-p w/wikipedia-last-response))
- (query (ht-get w/wikipedia-last-response "query"))
- (prepages (ht-get query "pages"))
- (pages (car (ht-values prepages)))
- (ext (ht-get pages "extract"))
- (dom (with-temp-buffer (insert ext) (libxml-parse-html-region (point-min) (point-max))))
- )
- (funcall k (s-trim (dom-texts dom)))
- (w/write-chat-event (format "Could not find Wikipedia page: %s" pagename))))))
+ (setq w/wikipedia-last-response data)
+ (if-let* ( ((ht-p w/wikipedia-last-response))
+ (query (ht-get w/wikipedia-last-response "query"))
+ (prepages (ht-get query "pages"))
+ (pages (car (ht-values prepages)))
+ (ext (ht-get pages "extract"))
+ (dom (with-temp-buffer (insert ext) (libxml-parse-html-region (point-min) (point-max))))
+ )
+ (funcall k (s-trim (dom-texts dom)))
+ (w/write-chat-event (format "Could not find Wikipedia page: %s" pagename))))))
nil))
(defcustom w/wiki-buffer "*wasp-wiki*"
@@ -62,12 +62,12 @@ Pass the resulting article summary to K."
(defun w/wikipedia-summary (page)
"Display a summary of PAGE from Wikipedia."
(w/fetch-wikipedia
- page
- (lambda (sum)
- (with-current-buffer (w/get-wiki-buffer)
- (let ((inhibit-read-only t))
- (erase-buffer)
- (w/write-line sum)))))
+ page
+ (lambda (sum)
+ (with-current-buffer (w/get-wiki-buffer)
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (w/write-line sum)))))
)
(provide 'wasp-wikipedia)