add catpoint-karaoke tool - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit b512f3d0b718672be434d6ff78132ff959482b1c
(DIR) parent 184caad66a4b23805ac3afcec77dc48107eb3ae2
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sat, 1 Aug 2026 00:13:15 +0200
add catpoint-karaoke tool
Signed-off-by: Annna Robert-Houdin <annna@bitreich.org>
Diffstat:
A modules/catpoint-karaoke/Makefile | 13 +++++++++++++
A modules/catpoint-karaoke/catpoint-… | 28 ++++++++++++++++++++++++++++
A modules/catpoint-karaoke/pres-form… | 47 +++++++++++++++++++++++++++++++
A modules/catpoint-karaoke/requireme… | 1 +
A modules/catpoint-karaoke/wikipedia… | 13 +++++++++++++
5 files changed, 102 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/modules/catpoint-karaoke/Makefile b/modules/catpoint-karaoke/Makefile
@@ -0,0 +1,13 @@
+.POSIX:
+
+VENV=./.venv
+PYTHON=${VENV}/bin/python
+
+run: ${VENV}
+ KARAOKE_PYTHON=${PYTHON} ./catpoint-karaoke.sh
+
+${VENV}: requirements.txt
+ python -m venv ${VENV}
+ ${VENV}/bin/pip install -r requirements.txt
+
+.PHONY: run
(DIR) diff --git a/modules/catpoint-karaoke/catpoint-karaoke.sh b/modules/catpoint-karaoke/catpoint-karaoke.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+python="${KARAOKE_PYTHON:-./.venv/bin/python}"
+gpt="${KARAOKE_GPT:-/home/annna/bin/gpt}"
+outdir="${KARAOKE_OUT:-/br/gopher/karaoke}"
+article="$(mktemp).md"
+
+while :
+do
+ if "${python}" ./wikipedia-random >"${article}"
+ then
+ if test "$(wc -l "${article}" | awk '{print $1}')" -ge 25
+ then
+ break
+ fi
+ fi
+ sleep 1
+done
+
+prompt="Create a funny presentation. <presentation_spec>$(cat pres-format.md)</presentation_spec>. <presentation_content>$(cat "${article}")</presentation_content>"
+response="$(printf '%s\n' "${prompt}" | NO_PASTING=1 "${gpt}")"
+printf '%s' "$response" >"${article}"
+
+hash="$(sha1sum "${article}" | cut -c 1-8)"
+presdir="${outdir}/${hash}"
+mkdir -p "${presdir}" && \
+ cd "${presdir}" && \
+ <"${article}" md2point && \
+ echo "${presdir}"
(DIR) diff --git a/modules/catpoint-karaoke/pres-format.md b/modules/catpoint-karaoke/pres-format.md
@@ -0,0 +1,47 @@
+# Presentation format
+
+The presentation must have 10 slides. See the example at the end of
+these instructions. Return the markdown itself, do not include markdown
+delimiters.
+
+First slide must be a title slide with the first-level header of the
+input as title and a teasing and thought-provoking subtitle.
+
+The second slide must be an outline of presentation contents in bullet form.
+
+The following 7 slides must contain content about the subject and a
+meaningful title in markdown level 2 heading.
+
+The final slide must be a summary and perspectivating for why the topic
+is important to the world.
+
+The input text uses mediawiki markup with "= header =" and "== subheader ==" style.
+
+Only these constructs are interpreted:
+
+- `## Title`: new slide; title indented and underlined with `=`. Bare `##` = untitled slide.
+- `#pause`: ends the slide, starts the next one as a copy of it (incremental reveal). Whole line only.
+
+No other markdown is parsed: no emphasis, links, code fences, or other heading
+levels. Nesting is literal indentation. Text before the first `##` is dropped.
+
+Below is an example. Replace the placeholder titles and text with real content.
+For slide content, use bullets and short sentences.
+
+```markdown
+## Presentation title
+Put an interesting subheader here
+
+## Outline
+- Put list of outline items here
+- ...
+
+## First content slide title
+* point
+ * sub point
+#pause
+Revealed after a keypress.
+
+## Conclusion
+- List overall conclusion points here
+```
(DIR) diff --git a/modules/catpoint-karaoke/requirements.txt b/modules/catpoint-karaoke/requirements.txt
@@ -0,0 +1 @@
+wikipedia
(DIR) diff --git a/modules/catpoint-karaoke/wikipedia-random b/modules/catpoint-karaoke/wikipedia-random
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+import sys
+import wikipedia as w
+
+def main():
+ w.set_user_agent("CatpointKaraokeBot/0.1 (https://bitreich.org; anders@adamsgaard.dk)")
+ page = w.random(pages=1)
+ print(page)
+ print(w.WikipediaPage(page).content)
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())