Public vals
167
tmcw
bandcampWrapped
HTTP
Bandcamp Wrapped It's Spotify Wrapped, but for Bandcamp! . Bandcamp is for people who buy their music and probably most of them hoard MP3s. Like me. And this val helps those people
turn their Bandcamp purchases of 2024 into HTML or Markdown suitable for blog posts on their blogs, which is probably a segment that has some overlap with the people who are
wacky enough to buy their music instead of streaming it from some service. Because Bandcamp doesn't have an API, this hinges on you going to your purchases page, copying the purchases, and pasting it in. Thanks to
the ability of the system clipboard to contain HTML , the same technology that makes
copy-and-pasted text have unpredictable and annoying font and boldness choices also lets this parse and reformat that purchases page into something
shareable. I would love for this to support embeds as well, but I haven't found a strategy yet:
Bandcamp embeds use album IDs in the URLs,
which are not exposed in the content on the purchases page. I'd have to scrape Bandcamp for that, which
would probably inevitably be blocked by some 'bot protection' system. Also read about this on macwright.com .
1
tmcw
chatgptchess
HTTP
ChatGPT Chess Inspired by all this hubbub about chess weirdness , this val lets you play chess against ChatGPT 4 . Expect some "too many requests" hiccups along the way. ChatGPT gets pretty bad at making valid moves after the first 10 or so
exchanges. This lets it retry up to 5 times to make a valid move, but if it can't, it can't.
0
tmcw
devstats
HTTP
Developer Statistics This val lets you post statistics from your GitHub Actions runs to build charts of change over time. We do this by having a step at the end of our actions run like this: - name: devstats
run: |
curl -X "POST" "https://tmcw-devstats.web.val.run/" \
-H 'Authorization: Bearer ${{ secrets.DEVSTATS_TOKEN }}' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $"{ \"name\": \"node_modules_kb\", \"value\": $(du -sk node_modules | awk '{print $1}') }" And setting a DEVSTATS_TOKEN value, which could be any short random value, both in Val Town environment variables
and as a secret in your GitHub Actions configuration. Currently the name you attach to a statistic can be anything, and the value is expected to be a number.
4
tmcw
typeboxExample
Script
This val demonstrates how TypeBox objects
are interchangeable with JSON Schema objects - if you run
JSON.stringify() on one of them, you immediately get a JSON Schema validator. They do, in memory, have additional methods and information, but their easy conversion
to JSON Schema objects is a major win.
0