Vals using htm
TODO List
Every web project needs a todo list, right? This is val.town's first (maybe?) With a healthy dose of htmx and web fundamentals, we're packing the essentials of a TODO list with server persistence and animations into about 60 lines. The data is stored in the @tmcw.todos val, for now. Try it out.
Generate a Val
Uses the OpenAI API to generate code for a val based on the description given by the user.
TODO:
- Improve code detection on GPT response
- Give more context on val town exclusive features like console.email or @references
- Enable the AI to search val town to find other vals to use
The Big Story
This val, along with @tmcw.big_story, which requests from the New York Times API, and @tmcw.big_stories_ranks, which contains the data, generates a visualization of top stories on the NYTimes homepage.
This is here just to ask the question – what happens to cover stories over time? Do they slowly drop down the page, or just get replaced by a fully new lede? So far it doesn't have quite enough data to answer that question.
But also, it might be neat because it'll show which kinds of stories make the front page - is it climate, war, politics, or something else?
Quick poll
https://tmcw-poll.express.val.run
This val, along with a val called poll_results
and a val called poll_options
, lets you conduct a little poll using just Val Town! With the express API, this exposes a web interface in which people can click an option and vote. We make sure everyone only votes once by setting a cookie in their browser.
This uses htmx to make the voting experience slick, Tailwind to style the UI, and htm to generate HTML for the pages.
If you want to use this yourself, fork this val, the poll_results val, and the poll_options val, and customize the options list. You can delete the existing results as well to clear the data.