😻 Your teal.fm scrobbles as a one-liner on your site. musicat.cuducos.me
README.md

Musicat #

Serves what a teal.fm or Rocksky account has been listening to, as a one-liner or JSON.

Requirements #

  • Go 1.27
  • JETSTREAM_API_KEY for the backfill (the live tail needs none)

Running #

go run .
Variable Default Purpose
MUSICAT_DB musicat.db Badger directory
MUSICAT_JETSTREAM_HOST https://jetstream.us-east.bsky.network Jetstream v2 host
MUSICAT_WINDOW_DAYS 90 Window served and retained
PORT 8000 Listen port
JETSTREAM_API_KEY Bearer key for the metered replay endpoints

API #

Route Returns
GET / Demo page (embedded)
GET /health 200 while the process runs
GET /ready 200 on the live tail, 503 while backfilling
GET /<DID or HANDLE> What the account has been listening to

/<DID or HANDLE> answers with the account's listening (last 90 days) as JSON:

[
  {name: string, image?: string},
  ...
]

Adding ?format= renders the template instead:

$ curl "localhost:8000/did:plc:…?format=Listening%20to%20{name1}%20and%20{name2}"
Listening to Sabrina Carpenter and Elza Soares.

Adding ?days= narrows the window, from 1 to MUSICAT_WINDOW_DAYS:

$ curl "localhost:8000/did:plc:…?days=7"
  • Placeholders are {name1}..{name10} and {image1}..{image10}; one with no entry is a 422.
  • Substitution is raw, not HTML-escaped.
  • image is omitted when there is no cover.