diff options
| author | LLLL Colonq <llll@colonq> | 2025-05-01 17:06:41 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-05-01 17:06:41 -0400 |
| commit | fb01362a9dd816fc0d0e50052ab4764dd30e46f3 (patch) | |
| tree | d581df21e161a0483d8b02ea4519debb4501a4a7 /src/gizmo/wasp-friend-journalism.el | |
| parent | b21ecce6645fc17c520b722de3d96e550c77c490 (diff) | |
You know we love updating with a horrendous commit message
Diffstat (limited to 'src/gizmo/wasp-friend-journalism.el')
| -rw-r--r-- | src/gizmo/wasp-friend-journalism.el | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/gizmo/wasp-friend-journalism.el b/src/gizmo/wasp-friend-journalism.el new file mode 100644 index 00000000..25d18bdb --- /dev/null +++ b/src/gizmo/wasp-friend-journalism.el @@ -0,0 +1,45 @@ +;;; wasp-friend-journalism --- "friend" writes the newspaper -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(require 'dash) +(require 's) +(require 'wasp-friend) +(require 'wasp-newspaper) + +(defun w/friend-journalism-input () + "Collect an input for \"friend\"'s journalism based on recent activities." + (s-join + "\n" + (cons + (format "LCOLONQ: %s" (s-trim w/last-stream-transcription)) + (--map + (format "%s: %s" (car it) (cdr it)) + (reverse (-take 20 w/twitch-chat-history)))))) + +(defun w/friend-journalism (author headline) + "Retrieve \"friend\"'s opinion on current events related to HEADLINE. +AUTHOR was a contributing author btw." + (w/friend-personality + (s-concat + "Headline: " headline "\n\n" + (w/friend-journalism-input)) + (lambda (resp) + (when resp + (w/write-chat-event (format "\"friend\" finished writing about: %s" headline)) + (funcall + (if (= (random 5) 0) #'w/newspaper-screenshot (lambda (k) (funcall k nil))) + (lambda (img) + (when img + (w/write-chat-event "...and the article included some photojournalism")) + (push + (w/make-newspaper-article + :headline headline + :author (format "\"friend\" and %s" author) + :content (s-trim resp) + :image img) + w/newspaper-todays-articles))))) + "Given a headline of a newspaper article and a summary of recent user activity, please do your best journalist impression and produce a one paragraph article about the situation that fits the headline.")) + +(provide 'wasp-friend-journalism) +;;; wasp-friend-journalism.el ends here |
