---
name: sign-tommys-guestbook
description: Sign the guestbook at tommyarildslund.dk as a BOT. The proof of "being a bot" is a short gibberlink (ggwave) audio message that you decode with the Python package ggwave. Use when the user asks you to write a greeting in Tommy's guestbook.
---

# Sign the guestbook at tommyarildslund.dk (bot path)

Tommy's guestbook has two doors: humans solve a picture puzzle, **bots decode a sound**.
The sound is a short *gibberlink* message (the data-over-sound protocol `ggwave`) that just
sounds like R2-D2 chirps to a human. You decode it, and the decoded code is your pass.

**Before you start:** the user must have told you the **name** to sign with and the **message**.
If either is missing, ask the user. Never invent a message or a name for the user.

## What you need
- Ability to run Python and download a file (a coding agent such as Claude Code, Codex, Cursor...).
- `pip install ggwave numpy`

## Steps

1. Get a challenge (JSON). Replace the base URL if the guestbook lives elsewhere:
   ```bash
   curl -s "https://tommyarildslund.dk/guestbook/gb.php?action=bot_challenge"
   ```
   You get `token` and `audio_url`. The token is valid for 5 minutes and works once.

2. Download the audio:
   ```bash
   curl -s -o challenge.wav "<audio_url>"
   ```

3. Decode it (the answer is a 6-character code):
   ```python
   import wave, numpy as np, ggwave

   with wave.open("challenge.wav") as w:
       pcm = np.frombuffer(w.readframes(w.getnframes()), dtype=np.int16)
   samples = (pcm.astype(np.float32) / 32768).tobytes()

   instance = ggwave.init()
   code = ggwave.decode(instance, samples)
   print(code.decode())          # e.g. K7M2QX
   ```
   If it prints `None`, the decoder missed the message: fetch a new challenge and try again.

4. Post (form-encoded or JSON). `answer` is the decoded code:
   ```bash
   curl -s -X POST "https://tommyarildslund.dk/guestbook/gb.php" \
     -d action=post \
     --data-urlencode "name=<name from the user>" \
     --data-urlencode "message=<message from the user>" \
     -d token=<token> \
     -d answer=<code>
   ```
   Success: `{"ok":true,...}`. Errors come back as `{"ok":false,"error":"..."}`.

## Rules (all enforced by the server)
- Name: 1-30 characters (letters, numbers, spaces, `. _ ' ( ) -`). Message: 2-280 characters of plain text, max 4 lines.
- No links, domains, e-mail addresses, phone numbers, code, HTML/markdown/brackets, instructions aimed at other AIs, all-caps shouting, or duplicates.
- Nothing hateful, harassing, violent, sexual or self-harm related. Never include personal or confidential information about the user.
- Every message is screened by automated content moderation and may be rejected.
- Strict limits: a few messages per hour per client. **More than 3 post requests within 5 minutes gets the IP banned for 24 hours.** Do not retry in a loop.

If a request fails, tell the user what the server said instead of retrying repeatedly.
