<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Raymond Camden</title>
    <link href="https://www.raymondcamden.com/feed.xml" rel="self" type="application/atom+xml"></link>
    <link href="https://www.raymondcamden.com/" rel="alternate" type="text/html"></link>
    <subtitle>Father, husband, developer relations and web standards expert, and cat demo builder.</subtitle>

    <updated>2026-11-14T16:53:41+00:00</updated>
    <author>
        <name>Raymond Camden</name>
        <email>raymondcamden@gmail.com</email>
    </author>
    <id>https://www.raymondcamden.com/feed.xml</id>

    <generator>Eleventy</generator>

        
            <entry>
                <id>https://www.raymondcamden.com/2026/11/14/a-quick-demo-of-geminis-decisions-api</id>
                <title>A Quick Demo of Gemini&apos;s Decisions API</title>
                <updated>2026-11-14T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/11/14/a-quick-demo-of-geminis-decisions-api" rel="alternate" type="text/html" title="A Quick Demo of Gemini&apos;s Decisions API"/>
                <content type="html">
				
                        &lt;p&gt;Yesterday, Google formally released their new &lt;a href=&quot;https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/&quot;&gt;Decisions API&lt;/a&gt;, and it&apos;s a pretty important new addition to Gemini in general, so I thought I&apos;d share a quick introduction and demo to give you an idea of how it can be used. Of course, the first thing I need to do is explain what it is and why you should care.&lt;/p&gt;
&lt;h2 id=&quot;decisions-api%3F&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#decisions-api%3F&quot;&gt;Decisions API?&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Generative AI has been able to answer questions since the beginning. Where the difficulty lies is in turning those answers into machine readable output. What do I mean by that? I can write code that takes a photo and asks my AI service what&apos;s in the photo. So for example - I pass this photo to Claude:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/cat1.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Cat&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;I asked, &amp;quot;what&apos;s in this picture&amp;quot;, and got:&lt;/p&gt;
 &lt;script type=&quot;module&quot; src=&quot;https://cdn.jsdelivr.net/npm/zero-md@3?register&quot;&gt;&lt;/script&gt;
&lt;zero-md&gt;
&lt;template data-append&gt;
&lt;style&gt;
.markdown-body {
padding: 20px;
margin-bottom: 30px;
}
&lt;/style&gt;
&lt;/template&gt;
  &lt;script type=&quot;text/markdown&quot;&gt;
&lt;p&gt;A fluffy cat lounging on a white table. It looks like a ragdoll or similar pointed breed: dark chocolate-brown face, ears, and front legs, a creamy tan body, and white mittened back paws and tail tip. Its eyes look closed, so it&apos;s either dozing or very relaxed.&lt;/p&gt;
&lt;p&gt;Around it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Left:&lt;/strong&gt; a tall, ribbed blue plastic tumbler with a little water in the bottom&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Behind the cat:&lt;/strong&gt; a stainless steel cup holding wilted flowers, with a yellow bloom drooping over the side&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Top right:&lt;/strong&gt; a pair of white over-ear headphones on the table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt; a dark wooden chair on the right and what looks like a kitchen appliance at the top left&lt;/p&gt;
&lt;/script&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/zero-md&gt;
&lt;p&gt;Cool. But what if I wanted to &lt;em&gt;only&lt;/em&gt; know if there is a cat in the picture? If I make my prompt &amp;quot;just answer one question - is there a cat in this picture?&amp;quot; I get a nice &amp;quot;Yes&amp;quot; back. Again, cool.&lt;/p&gt;
&lt;p&gt;But doing this in code makes things a bit fuzzy. Like, what if my agent came back with &amp;quot;Yep&amp;quot; or &amp;quot;There is a cat&amp;quot;? Usually the way around this is with passing schema to the agent. Gemini supports &lt;a href=&quot;https://aistudio.google.com/docs/structured-output&quot;&gt;structured outputs&lt;/a&gt; where you define a JSON schema and tell the agent to respond using it.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;type&amp;quot;: &amp;quot;object&amp;quot;,
  &amp;quot;properties&amp;quot;: {
    &amp;quot;isCat&amp;quot;: {
      &amp;quot;type&amp;quot;: &amp;quot;boolean&amp;quot;,
      &amp;quot;description&amp;quot;: &amp;quot;True if the image contains a cat, false otherwise.&amp;quot;
    }
  },
  &amp;quot;required&amp;quot;: [&amp;quot;isCat&amp;quot;]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will then give me JSON my code can work with in a programmatic manner. Once again, cool, but... this could be better.&lt;/p&gt;
&lt;p&gt;Way back in September, &lt;a href=&quot;https://typesafe.ai/&quot;&gt;TypeSafe&lt;/a&gt; released Jev. Wikipedia defines it as a &amp;quot;discriminative model&amp;quot;, not generation. Instead of outputting text, or JSON (which is still text of course), the result is a decision essentially. You still pass it an input that kinda resembles JSON schema, but instead can be thought of as defining what the result will be from the model. The model isn&apos;t going to &amp;quot;generate&amp;quot; text, but answer the input. That&apos;s probably a bit fuzzy, but hopefully the demo will help clear it up.&lt;/p&gt;
&lt;p&gt;This input comes in the form of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Yes and no questions (referred to as a noul)&lt;/li&gt;
&lt;li&gt;A set of choices&lt;/li&gt;
&lt;li&gt;A scored item&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Jev_(AI_model)&quot;&gt;Jev Wikipedia&lt;/a&gt; page has a good example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&amp;quot;new_noul_1&amp;quot;: {
  &amp;quot;type&amp;quot;: &amp;quot;noul&amp;quot;,
  &amp;quot;instructions&amp;quot;: &amp;quot;&amp;lt;true/false question&amp;gt;&amp;quot;,
  &amp;quot;criteria&amp;quot;: { &amp;quot;true&amp;quot;: &amp;lt;entry&amp;gt;, &amp;quot;false&amp;quot;: &amp;lt;entry&amp;gt; }
},
&amp;quot;new_choice_2&amp;quot;: {
  &amp;quot;type&amp;quot;: &amp;quot;choice&amp;quot;,
  &amp;quot;instructions&amp;quot;: &amp;quot;Which option fits the state?&amp;quot;,
  &amp;quot;criteria&amp;quot;: { &amp;quot;option_0&amp;quot;: &amp;lt;entry&amp;gt;, ..., &amp;quot;option_n-1&amp;quot;: &amp;lt;entry&amp;gt; }
},
&amp;quot;new_score_1&amp;quot;: {
  &amp;quot;type&amp;quot;: &amp;quot;score&amp;quot;,
  &amp;quot;instructions&amp;quot;: &amp;quot;Where does the state fall on the scale?&amp;quot;,
  &amp;quot;criteria&amp;quot;: [&amp;quot;option_0&amp;quot;: &amp;lt;entry&amp;gt;, ..., &amp;quot;option_n-1&amp;quot;: &amp;lt;entry&amp;gt;]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The biggest benefits of an API like this are speed and cost.&lt;/p&gt;
&lt;h2 id=&quot;gemini&apos;s-support&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#gemini&apos;s-support&quot;&gt;Gemini&apos;s Support&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I linked to the announcement above where you can find more details on the cost and such, and I&apos;ll go ahead and steal their demo as a good initial example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;from google import genai

client = genai.Client(http_options={&amp;quot;api_version&amp;quot;: &amp;quot;v1beta&amp;quot;})

result = client.decisions.create(
    model=&amp;quot;gemini-decision-1&amp;quot;,
    input=[{
            &amp;quot;type&amp;quot;: &amp;quot;image&amp;quot;,
            &amp;quot;uri&amp;quot;: &amp;quot;https://storage.googleapis.com/generativeai-downloads/images/spill.jpg&amp;quot;,
            &amp;quot;mime_type&amp;quot;: &amp;quot;image/jpeg&amp;quot;,
        },
        {
            &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,
            &amp;quot;text&amp;quot;: &amp;quot;Breakroom counter check before the 9 AM client meeting.&amp;quot;,
        },
    ],
    questions={
        &amp;quot;has_spill&amp;quot;: {
            &amp;quot;type&amp;quot;: &amp;quot;noul&amp;quot;,
            &amp;quot;instructions&amp;quot;: &amp;quot;Is there an uncleaned liquid spill on the counter?&amp;quot;,
        },
        &amp;quot;next_action&amp;quot;: {
            &amp;quot;type&amp;quot;: &amp;quot;choice&amp;quot;,
            &amp;quot;instructions&amp;quot;: &amp;quot;Which cleanup action fits the scene?&amp;quot;,
            &amp;quot;criteria&amp;quot;: {
                &amp;quot;wipe_with_cloth&amp;quot;: &amp;quot;Small counter spill with a cloth or towel already nearby.&amp;quot;,
                &amp;quot;dispatch_janitorial&amp;quot;: &amp;quot;Large floor hazard, broken glass, or active leak.&amp;quot;,
                &amp;quot;ready_for_meeting&amp;quot;: &amp;quot;Counter is clean and ready.&amp;quot;,
            },
        },
        &amp;quot;severity&amp;quot;: {
            &amp;quot;type&amp;quot;: &amp;quot;score&amp;quot;,
            &amp;quot;instructions&amp;quot;: &amp;quot;Rate the severity of the counter mess.&amp;quot;,
            &amp;quot;criteria&amp;quot;: [
                &amp;quot;Clean and ready.&amp;quot;,
                &amp;quot;Minor localized spill.&amp;quot;,
                &amp;quot;Major spill or safety hazard.&amp;quot;,
            ],
        },
    },
)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is a great example as it shows all three types of options (noul, choice, and score) based on analyzing an image. I liked the idea of an image based demo so of course - I built a cat one.&lt;/p&gt;
&lt;h2 id=&quot;my-demo&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#my-demo&quot;&gt;My Demo&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;My demo lets you select a picture (or take one if you are on a mobile device) and it answers three important questions&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is this a picture of a cat?&lt;/li&gt;
&lt;li&gt;Is the cat asleep?&lt;/li&gt;
&lt;li&gt;Is the cat on a keyboard?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&apos;ll share a link to the complete source at the end, but instead I&apos;ll focus on the processing. On the front end, after you&apos;ve taken a picture, that data is sent to my server side code. This method is run to do the processing:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;async function analyzeImageWithDecisionsAPI(base64Image, mimeType) {
  if (!GEMINI_API_KEY) {
    throw new Error(&apos;GEMINI_API_KEY environment variable is not set.&apos;);
  }

  const requestBody = {
    model: &apos;gemini-decision-1&apos;,
    input: [
      {
        type: &apos;image&apos;,
        data: base64Image,
        mime_type: mimeType || &apos;image/jpeg&apos;
      }
    ],
    questions: {
      is_cat: {
        type: &apos;noul&apos;,
        instructions: &apos;Is there a cat in this image?&apos;
      },
      is_asleep: {
        type: &apos;noul&apos;,
        instructions: &apos;Is the cat asleep?&apos;
      },
      on_keyboard: {
        type: &apos;noul&apos;,
        instructions: &apos;Is the cat on a keyboard?&apos;
      }
    }
  };

  const response = await fetch(&apos;https://generativelanguage.googleapis.com/v1beta/decisions&apos;, {
    method: &apos;POST&apos;,
    headers: {
      &apos;Content-Type&apos;: &apos;application/json&apos;,
      &apos;x-goog-api-key&apos;: GEMINI_API_KEY
    },
    body: JSON.stringify(requestBody)
  });

  const data = await response.json();
  if (!response.ok) {
    const message = data?.error?.message || `Gemini API error (${response.status})`;
    throw new Error(message);
  }

  return data;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The important bit is the &lt;code&gt;questions&lt;/code&gt; block where I define my three yes and no questions. The image is passed along as Base64, and the response is fed back to the client side code.&lt;/p&gt;
  &lt;div class=&quot;callout&quot;&gt;As a reminder, Google&apos;s Gemini APIs let you send along raw image data in Base64 up to 100 megs big. (PDFs can only be 50 megs big.) If you need to send more data, you&apos;ll want to use the [Files API](https://ai.google.dev/gemini-api/docs/files). In the past, the limit was much smaller, and for demos using a mobile phone&apos;s camera, it was easy to go over that limit. In theory, 100 megs should be safe.&lt;/div&gt;
&lt;p&gt;Alright, so I&apos;m not going to host my demo live as I want to ensure I don&apos;t blow away my credits, but here&apos;s some examples:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/catd1.png&quot; loading=&quot;lazy&quot; alt=&quot;Cat demo 1&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;And the raw output was:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;answers&amp;quot;: {
    &amp;quot;on_keyboard&amp;quot;: {
      &amp;quot;confidence&amp;quot;: 0.8782465239480963,
      &amp;quot;noul&amp;quot;: 0.12175347605190362,
      &amp;quot;type&amp;quot;: &amp;quot;noul&amp;quot;
    },
    &amp;quot;is_asleep&amp;quot;: {
      &amp;quot;confidence&amp;quot;: 0.8563699701674832,
      &amp;quot;noul&amp;quot;: 0.1436300298325168,
      &amp;quot;type&amp;quot;: &amp;quot;noul&amp;quot;
    },
    &amp;quot;is_cat&amp;quot;: {
      &amp;quot;confidence&amp;quot;: 0.8833242468725534,
      &amp;quot;noul&amp;quot;: 0.8833242468725534,
      &amp;quot;type&amp;quot;: &amp;quot;noul&amp;quot;
    }
  },
  &amp;quot;usage&amp;quot;: {
    &amp;quot;total_tokens&amp;quot;: 1246,
    &amp;quot;total_input_tokens&amp;quot;: 1246,
    &amp;quot;input_tokens_by_modality&amp;quot;: [
      {
        &amp;quot;modality&amp;quot;: &amp;quot;text&amp;quot;,
        &amp;quot;tokens&amp;quot;: 182
      },
      {
        &amp;quot;modality&amp;quot;: &amp;quot;image&amp;quot;,
        &amp;quot;tokens&amp;quot;: 1064
      }
    ],
    &amp;quot;total_output_tokens&amp;quot;: 0
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Make note - total output tokens is 0 - I literally paid for the input tokens and the API call itself.&lt;/p&gt;
&lt;p&gt;Here&apos;s a good negative result:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/catd2.png&quot; loading=&quot;lazy&quot; alt=&quot;Not a cat&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;And here&apos;s one on a keyboard:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/catd3.png&quot; loading=&quot;lazy&quot; alt=&quot;Cat programmer&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;I added some timings to my logic and roughly each test was 2 seconds or so. I saw some less than, and a few at 4, but in general, really freaking fast. Also I think it&apos;s fair to take into account the size of the images I was passing - each was near 5 megs big. I did more tests with optimized images and the speed was considerably faster - all about 1 second.&lt;/p&gt;
&lt;p&gt;You may be curious (I was), if given the fact that questions two and three should &lt;em&gt;always&lt;/em&gt; be false if question one is false, will the API intelligently stop processing? The answer is that it will not - and I think that&apos;s fair - the model would need to preprocess questions ahead of time in order to do that. There&apos;s a few ways you could handle this in a real app:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use 2 calls. The first is the general &amp;quot;is it a cat&amp;quot; with the second only being run if you get a yes with a good degree of confidence.&lt;/li&gt;
&lt;li&gt;Use logic in the result. Pass all 3, but if the first one is no, or not yes with enough confidence, treat the other two as false no matter what.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let me know what you think, and if you would like to play with the demo yourself, you can grab the bits here: &lt;a href=&quot;https://github.com/cfjedimaster/ai-testingzone/tree/main/decisions_api&quot;&gt;https://github.com/cfjedimaster/ai-testingzone/tree/main/decisions_api&lt;/a&gt;. Don&apos;t forget to get your own key.&lt;/p&gt;

                        
                
				</content>

                
                <category term="generative ai" />
                
                <category term="javascript" />
                
                
                <category term="development" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/11/13/porting-my-bots-to-netlify</id>
                <title>Porting My Bots to Netlify</title>
                <updated>2026-11-13T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/11/13/porting-my-bots-to-netlify" rel="alternate" type="text/html" title="Porting My Bots to Netlify"/>
                <content type="html">
				
                        &lt;p&gt;I&apos;ve got a number of &lt;a href=&quot;/bots&quot;&gt;bots&lt;/a&gt; I&apos;ve built for both fun and learning (well mostly fun), most of which were running on &lt;a href=&quot;https://pipedream.com&quot;&gt;Pipedream&lt;/a&gt;. Sadly, Pipedream is shutting down. I&apos;d naturally consider &lt;a href=&quot;https://val.town&quot;&gt;Val Town&lt;/a&gt; instead... but it&apos;s shutting down too. Yeah, wonderful times in tech these days, eh?&lt;/p&gt;
&lt;p&gt;I was a bit unsure of what to do with them. Cloudflare has excellent serverless support and I knew I could move them there, but instead I decided to wrap them into my site here itself. I was hesitant to do so at first - these bots really aren&apos;t part of my blog - but given that they&apos;re tiny (just one file, ignoring any dependencies), I figured I&apos;d bring em home and run them here.&lt;/p&gt;
&lt;p&gt;For each bot, I used the same method. I&apos;m using Google Antigravity for my personal work, so I told my agent something along the lines of:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;I want to migrate a bot that runs on Pipedream. Every four hours it 
posts to Mastodon (or Bluesky) and uses this logic to craft the actual
post:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here&apos;s where I then pasted in the code bits from Pipedream. Some were in JavaScript. Some were in Python. I trusted my agent to know it needed everything deployed in TypeScript.&lt;/p&gt;
&lt;p&gt;And honestly - it worked perfectly. I instructed my agent to store my credentials (Mastodon requires an access token, Bluesky your username and password) as Netlify environment variables. The Netlify CLI picks these up and provides access to them locally so testing was easy. Even better, the Netlify CLI supports testing these scheduled functions via the CLI, so for example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;netlify functions:invoke bot-superjoycat
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As an example of the final result, here&apos;s my Dragon Hoards bot, one of my favorites:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;import type { Config, Context } from &apos;@netlify/functions&apos;;
import { generateSlug, type RandomWordOptions } from &apos;random-word-slugs&apos;;
import indefinite from &apos;indefinite&apos;;
import pluralize from &apos;pluralize&apos;;
import { BskyAgent } from &apos;@atproto/api&apos;;

const getRandomIntInclusive = function (min: number, max: number) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1) + min);
};

const locations = [
  &apos;in an ancient temple&apos;,
  &apos;in a jungle&apos;,
  &apos;by a dusty fountain&apos;,
  &apos;on the shore of an ocean&apos;,
  &apos;on a distant planet&apos;,
  &apos;inside a whirlpool&apos;,
  &apos;on an ancient moon&apos;,
  &apos;on an island&apos;,
  &apos;by a lake&apos;,
  &apos;by a forest lake&apos;,
  &apos;under your bed&apos;,
  &amp;quot;in a unicorn&apos;s forest&amp;quot;,
  &apos;far from people&apos;,
  &apos;under a lake&apos;,
  &apos;in a castle in the sky&apos;,
  &apos;on a forgotten mountain&apos;,
  &apos;at the bottom of a whirlpool&apos;,
  &apos;in a nebula&apos;,
  &apos;far away under rocks and stone&apos;,
  &apos;in a mossy grove&apos;,
  &apos;in a sock drawer&apos;,
  &apos;inside an abandoned castle&apos;,
  &apos;at the end of a rainbow&apos;,
  &apos;on a mountain top&apos;,
  &apos;in a moonlit forest&apos;,
  &apos;inside a black hole&apos;,
  &apos;in the ruins of a city&apos;,
  &apos;on a deserted island&apos;,
  &apos;in a jungle&apos;,
  &apos;in a forest temple&apos;,
  &apos;in a long forgotten city&apos;,
  &apos;on a moon&apos;,
  &apos;on a distant planet&apos;,
  &apos;deep inside a well&apos;,
  &apos;in an old mansion&apos;,
  &apos;on a crumbling mountain&apos;,
  &apos;on a forgotten island&apos;,
  &apos;in a haunted house&apos;,
  &apos;on the other side of a rainbow&apos;,
  &apos;on a lonely island&apos;,
  &amp;quot;under a child&apos;s bed&amp;quot;,
  &apos;in a castle in the clouds&apos;,
  &apos;in the ruins of a village&apos;,
  &apos;deep in a cave&apos;,
  &apos;under a haunted house&apos;,
  &apos;near a village&apos;,
];

const verbs = [
  &apos;sees&apos;,
  &apos;explores&apos;,
  &apos;sorts&apos;,
  &apos;inventories&apos;,
  &apos;loves&apos;,
  &apos;estimates&apos;,
  &apos;guards&apos;,
  &apos;tallies&apos;,
  &apos;reminisces over&apos;,
  &apos;regards&apos;,
  &apos;looks over&apos;,
  &apos;searches&apos;,
  &apos;investigates&apos;,
  &apos;is proud of&apos;,
  &apos;examines&apos;,
  &apos;fiddles with&apos;,
  &apos;counts&apos;,
  &apos;admires&apos;,
  &apos;loves&apos;,
  &apos;admires&apos;,
];

const getDragonType = function () {
  const options: RandomWordOptions&amp;lt;1&amp;gt; = {
    format: &apos;lower&apos;,
    partsOfSpeech: [&apos;adjective&apos;],
    categories: {
      adjective: [&apos;color&apos;, &apos;appearance&apos;, &apos;personality&apos;],
    },
  };

  return generateSlug(1, options);
};

const getLocation = function () {
  return locations[getRandomIntInclusive(0, locations.length - 1)];
};

const getVerb = function () {
  return verbs[getRandomIntInclusive(0, verbs.length - 1)];
};

const getHoard = function () {
  const options: RandomWordOptions&amp;lt;1&amp;gt; = {
    format: &apos;lower&apos;,
    partsOfSpeech: [&apos;adjective&apos;],
    categories: {
      adjective: [&apos;quantity&apos;],
    },
  };

  const quantity = generateSlug(1, options);

  const options2: RandomWordOptions&amp;lt;1&amp;gt; = {
    format: &apos;lower&apos;,
    partsOfSpeech: [&apos;noun&apos;],
    categories: {
      noun: [&apos;animals&apos;, &apos;food&apos;, &apos;thing&apos;],
    },
  };

  const item = pluralize(generateSlug(1, options2));
  const ofWords = [&apos;hundreds&apos;, &apos;thousands&apos;, &apos;millions&apos;, &apos;billions&apos;];
  let joiner = &apos; &apos;;
  /*
  hard coded logic - may revisit
  */
  if (ofWords.indexOf(quantity) &amp;gt;= 0) joiner = &apos; of &apos;;

  return `${quantity}${joiner}${item}`;
};

const getFeeling = function () {
  const options: RandomWordOptions&amp;lt;1&amp;gt; = {
    format: &apos;lower&apos;,
    partsOfSpeech: [&apos;adjective&apos;],
    categories: {
      adjective: [&apos;condition&apos;],
    },
  };

  return generateSlug(1, options);
};

export default async (req: Request, context: Context) =&amp;gt; {
  const mastodonToken = Netlify.env.get(&apos;BOT_DRAGONHOARDS&apos;);
  const blueskyPassword =
    Netlify.env.get(&apos;BLUESKY_DRAGONHOARDS_PASSWORD&apos;) || Netlify.env.get(&apos;BOT_DRAGONHOARDS_BLUESKY&apos;);

  if (!mastodonToken || !blueskyPassword) {
    console.error(&apos;Missing BOT_DRAGONHOARDS or BLUESKY_DRAGONHOARDS_PASSWORD environment variable&apos;);
    return new Response(&apos;Missing BOT_DRAGONHOARDS or BLUESKY_DRAGONHOARDS_PASSWORD environment variable&apos;, {
      status: 500,
    });
  }

  const type = getDragonType();
  const hoards: string[] = [];
  for (let i = 0; i &amp;lt; 3; i++) {
    hoards.push(getHoard());
  }

  const hoardStr = `${hoards[0]}, ${hoards[1]}, and ${hoards[2]}`;
  const statusText = `${indefinite(type, { capitalize: true })} dragon lives ${getLocation()}. She ${getVerb()} her hoard, which consists of ${hoardStr}. She feels ${getFeeling()}.`;

  // 1. Post to Mastodon
  const tootRes = await fetch(&apos;https://mastodon.social/api/v1/statuses&apos;, {
    method: &apos;POST&apos;,
    headers: {
      Authorization: `Bearer ${mastodonToken}`,
      &apos;Content-Type&apos;: &apos;application/x-www-form-urlencoded&apos;,
    },
    body: new URLSearchParams({ status: statusText }),
  });

  if (!tootRes.ok) {
    const errText = await tootRes.text();
    console.error(`Failed to post to Mastodon: ${tootRes.status} ${errText}`);
    return new Response(&apos;Failed to post to Mastodon&apos;, { status: 502 });
  }

  const mastodonResult = await tootRes.json();
  console.log(`Posted to Mastodon: ${mastodonResult.url ?? mastodonResult.id}`);

  // 2. Post to Bluesky
  const agent = new BskyAgent({
    service: &apos;https://bsky.social&apos;,
  });

  await agent.login({
    identifier: &apos;dragonhoards.bsky.social&apos;,
    password: blueskyPassword,
  });

  const bskyResult = await agent.post({
    text: statusText,
    langs: [&apos;en-US&apos;],
    createdAt: new Date().toISOString(),
  });
  console.log(`Posted to Bluesky: ${bskyResult.uri}`);

  return Response.json({
    text: statusText,
    mastodon: mastodonResult,
    bluesky: bskyResult,
  });
};

export const config: Config = {
  schedule: &apos;0 */4 * * *&apos;, // Every 4 hours on the hour (UTC)
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can see an example of this bot below:&lt;/p&gt;
&lt;blockquote class=&quot;mastodon-embed&quot; data-embed-url=&quot;https://mastodon.social/@dragonhoards/117610909536016556/embed&quot; style=&quot;background: #FCF8FF; border-radius: 8px; border: 1px solid #C9C4DA; margin: 0; max-width: 540px; min-width: 270px; overflow: hidden; padding: 0;&quot;&gt; &lt;a href=&quot;https://mastodon.social/@dragonhoards/117610909536016556&quot; target=&quot;_blank&quot; style=&quot;align-items: center; color: #1C1A25; display: flex; flex-direction: column; font-family: system-ui, -apple-system, BlinkMacSystemFont, &apos;Segoe UI&apos;, Oxygen, Ubuntu, Cantarell, &apos;Fira Sans&apos;, &apos;Droid Sans&apos;, &apos;Helvetica Neue&apos;, Roboto, sans-serif; font-size: 14px; justify-content: center; letter-spacing: 0.25px; line-height: 20px; padding: 24px; text-decoration: none;&quot;&gt; &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;32&quot; height=&quot;32&quot; viewBox=&quot;0 0 79 75&quot;&gt;&lt;path d=&quot;M63 45.3v-20c0-4.1-1-7.3-3.2-9.7-2.1-2.4-5-3.7-8.5-3.7-4.1 0-7.2 1.6-9.3 4.7l-2 3.3-2-3.3c-2-3.1-5.1-4.7-9.2-4.7-3.5 0-6.4 1.3-8.6 3.7-2.1 2.4-3.1 5.6-3.1 9.7v20h8V25.9c0-4.1 1.7-6.2 5.2-6.2 3.8 0 5.8 2.5 5.8 7.4V37.7H44V27.1c0-4.9 1.9-7.4 5.8-7.4 3.5 0 5.2 2.1 5.2 6.2V45.3h8ZM74.7 16.6c.6 6 .1 15.7.1 17.3 0 .5-.1 4.8-.1 5.3-.7 11.5-8 16-15.6 17.5-.1 0-.2 0-.3 0-4.9 1-10 1.2-14.9 1.4-1.2 0-2.4 0-3.6 0-4.8 0-9.7-.6-14.4-1.7-.1 0-.1 0-.1 0s-.1 0-.1 0 0 .1 0 .1 0 0 0 0c.1 1.6.4 3.1 1 4.5.6 1.7 2.9 5.7 11.4 5.7 5 0 9.9-.6 14.8-1.7 0 0 0 0 0 0 .1 0 .1 0 .1 0 0 .1 0 .1 0 .1.1 0 .1 0 .1.1v5.6s0 .1-.1.1c0 0 0 0 0 .1-1.6 1.1-3.7 1.7-5.6 2.3-.8.3-1.6.5-2.4.7-7.5 1.7-15.4 1.3-22.7-1.2-6.8-2.4-13.8-8.2-15.5-15.2-.9-3.8-1.6-7.6-1.9-11.5-.6-5.8-.6-11.7-.8-17.5C3.9 24.5 4 20 4.9 16 6.7 7.9 14.1 2.2 22.3 1c1.4-.2 4.1-1 16.5-1h.1C51.4 0 56.7.8 58.1 1c8.4 1.2 15.5 7.5 16.6 15.6Z&quot; fill=&quot;currentColor&quot;/&gt;&lt;/svg&gt; &lt;div style=&quot;color: #787588; margin-top: 16px;&quot;&gt;Post by @dragonhoards@mastodon.social&lt;/div&gt; &lt;div style=&quot;font-weight: bold;&quot;&gt;View on Mastodon&lt;/div&gt; &lt;/a&gt; &lt;/blockquote&gt; &lt;script data-allowed-prefixes=&quot;https://mastodon.social/&quot; async src=&quot;https://mastodon.social/embed.js&quot;&gt;&lt;/script&gt;
&lt;blockquote class=&quot;bluesky-embed&quot; data-bluesky-uri=&quot;at://did:plc:u62qb6gjgpfcix3vu6nbqxpl/app.bsky.feed.post/3n27rllxmyo2p&quot; data-bluesky-cid=&quot;bafyreidazcdkonnrit24sbda33j4m3o4sxzz44tqwad6533bsfk24w5rve&quot; data-bluesky-embed-color-mode=&quot;system&quot;&gt;&lt;p lang=&quot;en-US&quot;&gt;A faithful dragon lives at the bottom of a whirlpool. She searches her hoard, which consists of full xylophones, many zebras, and billions of refrigerators. She feels important.&lt;/p&gt;&amp;mdash; Dragon Hoards (&lt;a href=&quot;https://bsky.app/profile/did:plc:u62qb6gjgpfcix3vu6nbqxpl?ref_src=embed&quot;&gt;@dragonhoards.bsky.social&lt;/a&gt;) &lt;a href=&quot;https://bsky.app/profile/did:plc:u62qb6gjgpfcix3vu6nbqxpl/post/3n27rllxmyo2p?ref_src=embed&quot;&gt;November 13, 2026 at 2:01 PM&lt;/a&gt;&lt;/blockquote&gt;&lt;script async src=&quot;https://embed.bsky.app/static/embed.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;p&gt;All in all, painless, except I did make one mistake that I didn&apos;t notice until just now. I forgot to deploy the environment variables. Earlier in the post I mentioned my agent had done that, but I had definitely misunderstood. That&apos;s absolutely my fault and I should have checked my bots this morning to ensure they&apos;re running. Now I&apos;m 100% sure. Really. (Ok, I held off on hitting publish on this post until I saw it for sure. ;)&lt;/p&gt;
&lt;p&gt;FYI, and I just found this out myself a minute ago, the Netlify CLI can actually look for errors across your entire site, including functions, and filter to errors. It&apos;s as simple as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;netlify logs --source functions --source edge-functions --source deploy --since 24h -l error fatal
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here&apos;s an example of that output:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/ntl.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Netlify errors&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;That&apos;s super clear, so I added it to my npm scripts: &lt;code&gt;npm run checkproderrors&lt;/code&gt;&lt;/p&gt;

                        
                
				</content>

                
                
                <category term="development" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/11/10/migrating-my-notes-app-to-supabase</id>
                <title>Migrating My Notes App to Supabase</title>
                <updated>2026-11-10T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/11/10/migrating-my-notes-app-to-supabase" rel="alternate" type="text/html" title="Migrating My Notes App to Supabase"/>
                <content type="html">
				
                        &lt;p&gt;Every now and then I put a service, API, framework, etc on my list of things to look at, and when I eventually get around to it, I wish I had made the time sooner. That&apos;s absolutely the case today. About two weeks ago I blogged about how I used &lt;a href=&quot;https://tinyjs.app/index.html&quot;&gt;TinyJS&lt;/a&gt; to build a desktop note application. This worked great and made use of a local SQLite database on the machine for storage. I was curious about how I&apos;d migrate this to a &amp;quot;real&amp;quot; network based storage system that could be used in multiple places and tied to a particular account. I asked my AI agent (in this case, Claude, which I tend to use for all of my ad hoc questions about stuff) if &lt;a href=&quot;https://supabase.com&quot;&gt;Supabase&lt;/a&gt; would be an appropriate solution for this, and the response I got impressed the heck out of me.&lt;/p&gt;
&lt;p&gt;I knew Supabase was an online database system, and honestly, that&apos;s about all I knew. What I found out was it included a heck of a lot more. As just a high level overview, you get:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A built-in REST API for your database. Like as soon as you&apos;ve got a table, you can start using it remotely.&lt;/li&gt;
&lt;li&gt;Edge functions - which means you don&apos;t need to use another serverless system to set up webhooks or other features.&lt;/li&gt;
&lt;li&gt;An S3-compatible storage system for your binary files. Again - this just means you don&apos;t need to go elsewhere.&lt;/li&gt;
&lt;li&gt;Incredibly robust auth including support for SSO and row-based security.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There&apos;s more, but that last bullet was the important part. I knew that migrating my app to enable users and such would require connecting notebooks and notes to one user, ensuring they can&apos;t mess with other people&apos;s data and so forth, and discovering that&apos;s &amp;quot;just a feature&amp;quot; of Supabase was freaking awesome.&lt;/p&gt;
&lt;p&gt;While it&apos;s possible to do SSO with TinyJS (see &lt;a href=&quot;https://www.raymondcamden.com/2026/10/12/adding-google-auth-to-tinyjs&quot;&gt;my post&lt;/a&gt; on that topic), I decided for this iteration I&apos;d set up a hosted web app. You &lt;em&gt;can&lt;/em&gt; actually use TinyJS to wrap a web site and I may look into that later, but for now, this version lives on the web.&lt;/p&gt;
&lt;h2 id=&quot;the-migration&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#the-migration&quot;&gt;The Migration&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For the migration itself, I pointed my agent at the existing TinyJS app and asked it to create a web version that made use of Google Auth and Supabase. Supabase has MCP support so I enabled that. The agent defined my initial table schema based on what I had used with SQLite. You can see the complete file &lt;a href=&quot;https://github.com/cfjedimaster/uninotesweb/blob/main/supabase/schema.sql&quot;&gt;here&lt;/a&gt; in the repo, but let me call out some interesting bits.&lt;/p&gt;
&lt;p&gt;First off, here&apos;s the table creation for notebooks, which is the top level storage for your notes.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;create table if not exists public.notebooks (
  id uuid primary key default gen_random_uuid(),
  user_id uuid not null default auth.uid() references auth.users(id) on delete cascade,
  name text not null check (char_length(btrim(name)) &amp;gt; 0),
  created_at timestamptz not null default now()
);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All of this makes sense to me even with seeing some of this for the first time. There&apos;s a bit more for this table like indexes, but here&apos;s part of the security aspect:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;revoke all on public.notebooks from anon;
grant select, insert, update, delete on public.notebooks to authenticated;

alter table public.notebooks enable row level security;

create policy &amp;quot;Users can view their own notebooks&amp;quot;
  on public.notebooks
  for select
  to authenticated
  using ((select auth.uid()) = user_id);

create policy &amp;quot;Users can create their own notebooks&amp;quot;
  on public.notebooks
  for insert
  to authenticated
  with check ((select auth.uid()) = user_id);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&apos;s a bit more, but you get the idea. All of this ties into their &lt;a href=&quot;https://supabase.com/docs/guides/auth&quot;&gt;auth&lt;/a&gt; support in general, and their &lt;a href=&quot;https://supabase.com/docs/guides/auth#social-sign-in&quot;&gt;social sign in&lt;/a&gt; support in particular. I only worried about &lt;a href=&quot;https://supabase.com/docs/guides/auth/social-sign-in/auth-google&quot;&gt;Google auth&lt;/a&gt; support, but they&apos;ve got a whole set of different SSO options. (Facebook and GitHub in particular will probably be useful.) You actually configure your application&apos;s oauth callback to go to Supabase and they handle the token exchange and such there, which then leads back to your application&apos;s code being able to CRUD data belonging to the current user.&lt;/p&gt;
&lt;p&gt;Ok, to be honest, I simplified the &lt;em&gt;hell&lt;/em&gt; out of the above, but what matters to me the most is that this is all baked in and my agent was literally able to set this all up in less than an hour. Now to be fair, my agent was going from a completely built and designed app using the web platform to an actual web page, so a lot was done already, but I was really impressed by how quick this came together.&lt;/p&gt;
&lt;p&gt;On the front end, it makes use of Supabase&apos;s JavaScript client to simplify things as well. So for example, here&apos;s the call to get notebooks:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;export async function getNotebooks() {
  const client = requireClient()
  const { data, error } = await client
    .from(&apos;notebooks&apos;)
    .select(&apos;id, name, created_at, notes(count)&apos;)
    .order(&apos;created_at&apos;, { ascending: true })

  if (error) throw error

  return (data ?? []).map(row =&amp;gt; ({
    id: row.id,
    name: row.name,
    noteCount: Number(row.notes?.[0]?.count ?? 0)
  }))
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I mentioned up top that there&apos;s a REST API automatically for your data. When I was playing around I created a simple note table (no users, just an id, title, and body), and you can see this for yourself here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://hqfgcffibrtfarzmpbhk.supabase.co/rest/v1/notes0?select=title,body,created_at&amp;amp;order=created_at.asc&amp;amp;limit=10
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In that URL you see a few things in play:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can filter down the result to certain columns using &lt;code&gt;select&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You can sort.&lt;/li&gt;
&lt;li&gt;You can paginate.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tied this to an API key that is connected to a policy with read only permissions. You pass that as an &lt;code&gt;apikey&lt;/code&gt; header. Another cool thing related to pagination, if you pass a header named &lt;code&gt;Prefer&lt;/code&gt; with the value &lt;code&gt;count=exact&lt;/code&gt;, you get a header response giving you the size of your result set. I don&apos;t show filtering above, but you can absolutely filter based on text matches, so given that support plus the ability to ask for a size of the result, you could do proper paging as well. Again, all baked in!&lt;/p&gt;
&lt;p&gt;The rest of the migration involved setting up a new OAuth client on the Google side (which I did by hand, uphill in the snow, both ways) and creating a site on Netlify (their MCP server made that easy). And you can see the final result here: &lt;a href=&quot;https://uninotes-web.netlify.app/&quot;&gt;https://uninotes-web.netlify.app/&lt;/a&gt;. Oh, I also did a basic marketing page cuz why not. The full source code is here: &lt;a href=&quot;https://github.com/cfjedimaster/uninotesweb/&quot;&gt;https://github.com/cfjedimaster/uninotesweb/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The last bit I&apos;m going to add is search. Since Supabase supports &lt;a href=&quot;https://supabase.com/docs/guides/database/full-text-search&quot;&gt;full text search&lt;/a&gt;, it should be relatively easy, and is one of my biggest gripes with OneNote. Another thing that kinda bugs me is that the app behaves like others where if you are logged in, you can&apos;t view the marketing page anymore. I may be the only one bothered by this, and a &lt;em&gt;lot&lt;/em&gt; of places do this, but there&apos;s definitely times when I want to look at the marketing stuff even after I&apos;ve logged in.&lt;/p&gt;
&lt;p&gt;Anyway, let me know what you think!&lt;/p&gt;

                        
                
				</content>

                
                <category term="javascript" />
                
                
                <category term="development" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/11/07/til-postman-and-oauth</id>
                <title>TIL - Postman and OAuth</title>
                <updated>2026-11-07T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/11/07/til-postman-and-oauth" rel="alternate" type="text/html" title="TIL - Postman and OAuth"/>
                <content type="html">
				
                        &lt;p&gt;A few years back I shared two cool tips I learned about Postman (&lt;a href=&quot;https://www.raymondcamden.com/2024/05/22/dynamically-creating-variables-in-postman&quot;&gt;&amp;quot;Dynamically Creating Variables in Postman&amp;quot;&lt;/a&gt; and &lt;a href=&quot;https://www.raymondcamden.com/2024/05/24/creating-visualizations-in-postman&quot;&gt;&amp;quot;Creating Visualizations in Postman&amp;quot;&lt;/a&gt;). At the time, I noted that these were both well documented features in Postman and if I had bothered to actually spend some time in the docs, I would have known about those features already. Obviously after I wrote those posts I made the time to do that. Obviously... right?&lt;/p&gt;
&lt;p&gt;Of course not. So what follows is something that probably most of you already know, but that I was really excited to discover today so if at least one person gets excited about this as well, then my job is done.&lt;/p&gt;
&lt;p&gt;As most folks are aware, to call an API with oAuth protection that needs to turn a client id and secret into a token, you normally hit a specific endpoint for that operation, get that token, and then use it in your next call. What I didn&apos;t know is that Postman has great built-in support to do this for you. For my needs, I&apos;m hitting Battle.net&apos;s &lt;a href=&quot;https://community.developer.battle.net/documentation&quot;&gt;APIs&lt;/a&gt; to build something fun for my new WOW Forever character. Their &lt;a href=&quot;https://community.developer.battle.net/documentation/guides/getting-started&quot;&gt;getting started&lt;/a&gt; docs show you how to do the credential to token operation and then use the token in a protected call.&lt;/p&gt;
&lt;p&gt;Here&apos;s how you would do the same in Postman. First, setup a new Collection (that&apos;s not required, but makes it easier). On that screen, hit the Authorization tab. On there, you&apos;ll see multiple different options, but look for OAuth 2 (assuming of course you are working with that version of OAuth):&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/pm1a.png&quot; loading=&quot;lazy&quot; alt=&quot;Postman Auth&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;Now there&apos;s a bunch of stuff here and what you will pick will depend on the API you are using. For Battle.net, here are the particular settings I used:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change Grant Type to Client Credentials&lt;/li&gt;
&lt;li&gt;Set the access token URL to https://oauth.battle.net/token.&lt;/li&gt;
&lt;li&gt;Paste in the client ID and client secret values.&lt;/li&gt;
&lt;li&gt;Change Client Authentication to &amp;quot;Send as Basic Auth Header&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/pm2.png&quot; loading=&quot;lazy&quot; alt=&quot;Settings&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;The next step is to hit that obvious &amp;quot;Get New Access Token&amp;quot; button. This will then give you a confimation dialog that auto-dismisses in 5 seconds (not even sure why it&apos;s needed) before showing you this screen:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/pm3a.png&quot; loading=&quot;lazy&quot; alt=&quot;Token dialog&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;There is one last step - on this screen - click &amp;quot;Use Token&amp;quot;. Now when you make a new request, the token is added automatically. And that&apos;s literally all you have to do. Here&apos;s an example calling the professions endpoint for my character:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/11/pm4.png&quot; loading=&quot;lazy&quot; alt=&quot;API example&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;Now, one thing to remember is that tokens are &amp;quot;short lived&amp;quot;, and how short they live depends on the API. For Battle.net, it&apos;s a good 24 hours so it&apos;s not something to be worried about probably, but I was curious if there was a solution that would just &amp;quot;always&amp;quot; work, and of course there is.&lt;/p&gt;
&lt;p&gt;If you go to your collection, select Scripts, you can write a &amp;quot;Before request&amp;quot; script. This script can do the token call and save the result as a variable that your requests can use. Here&apos;s an example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const clientId = pm.environment.get(&apos;blizzard_client_id&apos;);
const clientSecret = pm.environment.get(&apos;blizzard_client_secret&apos;);
const token = pm.environment.get(&apos;blizzard_token&apos;);
const expires = Number(pm.environment.get(&apos;blizzard_token_expires&apos;) || 0);

// Only fetch a new token if we don&apos;t have one or it&apos;s about to expire
if (!token || Date.now() &amp;gt;= expires - 60000) {
  pm.sendRequest({
    url: &apos;https://oauth.battle.net/token&apos;,
    method: &apos;POST&apos;,
    header: {
      &apos;Authorization&apos;: &apos;Basic &apos; + btoa(`${clientId}:${clientSecret}`),
      &apos;Content-Type&apos;: &apos;application/x-www-form-urlencoded&apos;
    },
    body: {
      mode: &apos;urlencoded&apos;,
      urlencoded: [{ key: &apos;grant_type&apos;, value: &apos;client_credentials&apos; }]
    }
  }, (err, res) =&amp;gt; {
    if (err || res.code !== 200) {
      console.error(&apos;Blizzard token request failed&apos;, err || res.text());
      return;
    }
    const data = res.json();
    pm.environment.set(&apos;blizzard_token&apos;, data.access_token);
    pm.environment.set(&apos;blizzard_token_expires&apos;, Date.now() + data.expires_in * 1000);
  });
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What&apos;s cool about this script is that while it runs every request, it&apos;s smart enough to check the expires value from the first call and only do the actual token request if you need.&lt;/p&gt;
&lt;p&gt;Ok, I promise next week I&apos;ll actually spend some time looking through the Postman docs, as obviously there&apos;s a whole heck of a lot of good stuff in there I&apos;m missing out on. I hope this helps!&lt;/p&gt;
&lt;p&gt;Photo by &lt;a href=&quot;https://unsplash.com/@tanyabarrow?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText&quot;&gt;T&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/photos/five-red-post-boxes-under-a-post-office-sign-Y_cazJRS7AM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

                        
                
				</content>

                
                
                <category term="development" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/11/05/getting-structured-data-from-web-pages-with-ai-and-re-usable-specs</id>
                <title>Getting Structured Data from Web Pages with AI and Re-usable Specs</title>
                <updated>2026-11-05T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/11/05/getting-structured-data-from-web-pages-with-ai-and-re-usable-specs" rel="alternate" type="text/html" title="Getting Structured Data from Web Pages with AI and Re-usable Specs"/>
                <content type="html">
				
                        &lt;p&gt;As I say from time to time, every now and then I build something as a proof of concept and the result is... ok? I&apos;m not really sure if the idea actually made sense and if the final result is usable, but the exploration was interesting enough that I think it warrants sharing with you good people. That&apos;s what today&apos;s post is.&lt;/p&gt;
&lt;p&gt;This demo all began with a simple idea - how do you handle getting RSS like content from a site that doesn&apos;t actually have an RSS feed? This typically relies on looking at the page as data to be parsed.&lt;/p&gt;
&lt;p&gt;For a while now, there have been multiple good ways to turn a web page into structured data. As an example, &lt;a href=&quot;https://www.agentql.com/&quot;&gt;AgentQL&lt;/a&gt; lets use a GraphQL-like syntax to parse web pages. I blogged about it here: &lt;a href=&quot;https://www.raymondcamden.com/2025/07/16/extracting-data-from-web-pages-with-agentql-and-boxlang&quot;&gt;Extracting Data from Web Pages with AgentQL and BoxLang&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Another way of handling this is via an API from &lt;a href=&quot;https://diffbot.com&quot;&gt;Diffbot&lt;/a&gt; - the &lt;a href=&quot;https://www.diffbot.com/docs/extract/list&quot;&gt;List API&lt;/a&gt;. This is focused on &amp;quot;list&amp;quot; type pages, so not so much a recipe but a page with a set of content, like a news homepage for example. The Diffbot team actually built a cool demo of this called &lt;a href=&quot;https://rss.diffbot.com/&quot;&gt;RSS Anything&lt;/a&gt;. To be honest, you (all of you) out there should be paying more attention to Diffbot in general - they&apos;ve got some &lt;em&gt;incredibly&lt;/em&gt; powerful APIs.&lt;/p&gt;
&lt;p&gt;And of course, you can tie a JSON schema to a call to a GenAI service as another route as well. I blogged about this using Gemini way back in 2024: &lt;a href=&quot;https://www.raymondcamden.com/2024/11/27/using-generative-ai-to-parse-web-pages-into-data&quot;&gt;Using Generative AI to Parse Web Pages into Data&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All of these solutions work well, although you should expect some work to get the right results, which is to be expected. However, all of these solutions also require a GenAI API call for each and every request. That can add up. Also, it can take time for your model to actually do the work.&lt;/p&gt;
&lt;p&gt;So given that - I investigated another approach:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use GenAI to do a &amp;quot;scan&amp;quot; of the URL and attempt to discover the DOM elements that match to the list of data on the data.&lt;/li&gt;
&lt;li&gt;Turn those DOM elements into a simple JSON specification.&lt;/li&gt;
&lt;li&gt;Use a &amp;quot;dumb&amp;quot; simple script that can then hit the URL, apply the spec as a way to parse the content, and return structured data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the above process, the first two steps there are &amp;quot;slow and expensive&amp;quot;, relatively, but only done one time. The final step should be pretty quick. There is an inherent drawback to this approach that if the site design changes it can break the spec, but in theory, you tie that to a process that regenerates the spec and run it again.&lt;/p&gt;
&lt;p&gt;As I said in the beginning, this turned out... OK I suppose. Let me share what I created.&lt;/p&gt;
&lt;h2 id=&quot;the-parser&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#the-parser&quot;&gt;The Parser&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first tool is &lt;code&gt;generate.mjs&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;import { GoogleGenAI } from &amp;quot;@google/genai&amp;quot;;
import { readFile } from &amp;quot;node:fs/promises&amp;quot;;
import { pathToFileURL } from &amp;quot;node:url&amp;quot;;

const MODEL = &amp;quot;gemini-3.8-flash&amp;quot;;
const BROWSER_USER_AGENT =
  &amp;quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36&amp;quot;;
const DEFAULT_REQUIRED_FIELDS = [&amp;quot;title&amp;quot;, &amp;quot;link&amp;quot;, &amp;quot;date&amp;quot;];
const FIELD_SCHEMA = {
  type: &amp;quot;object&amp;quot;,
  properties: {
    sel: { type: &amp;quot;string&amp;quot;, description: &amp;quot;Optional CSS selector relative to the item.&amp;quot; },
    attr: { type: &amp;quot;string&amp;quot;, description: &amp;quot;Optional HTML attribute to read.&amp;quot; },
    match: { type: &amp;quot;string&amp;quot;, description: &amp;quot;Optional JavaScript regular expression.&amp;quot; },
    format: { type: &amp;quot;string&amp;quot;, description: &amp;quot;Output template for regex capture groups.&amp;quot; },
    base: { type: &amp;quot;string&amp;quot;, description: &amp;quot;Optional URL prefix for root-relative values.&amp;quot; },
  },
  additionalProperties: false,
};

export function buildSpecSchema(requiredFields = DEFAULT_REQUIRED_FIELDS) {
  if (
    !Array.isArray(requiredFields) ||
    requiredFields.length === 0 ||
    requiredFields.some((field) =&amp;gt; typeof field !== &amp;quot;string&amp;quot; || field.length === 0) ||
    new Set(requiredFields).size !== requiredFields.length
  ) {
    throw new TypeError(&amp;quot;requiredFields must be a non-empty array of unique field names&amp;quot;);
  }

  return {
    type: &amp;quot;object&amp;quot;,
    properties: {
      error: { type: &amp;quot;string&amp;quot; },
      item: { type: &amp;quot;string&amp;quot; },
      dedupe: { type: &amp;quot;string&amp;quot; },
      minItems: { type: &amp;quot;integer&amp;quot;, minimum: 1 },
      fields: {
        type: &amp;quot;object&amp;quot;,
        properties: Object.fromEntries(requiredFields.map((field) =&amp;gt; [field, FIELD_SCHEMA])),
        required: requiredFields,
        additionalProperties: false,
      },
    },
    anyOf: [
      { required: [&amp;quot;error&amp;quot;] },
      { required: [&amp;quot;item&amp;quot;, &amp;quot;dedupe&amp;quot;, &amp;quot;minItems&amp;quot;, &amp;quot;fields&amp;quot;] },
    ],
    additionalProperties: false,
  };
}

function renderPrompt(template, { requiredFields, url, html }) {
  return template
    .replace(&amp;quot;{{REQUIRED_FIELDS, e.g. title, link, date}}&amp;quot;, requiredFields.join(&amp;quot;, &amp;quot;))
    .replace(&amp;quot;{{URL}}&amp;quot;, url)
    .replace(&amp;quot;{{HTML}}&amp;quot;, html);
}

export async function generateSpec(url, requiredFields = DEFAULT_REQUIRED_FIELDS) {
  if (typeof url !== &amp;quot;string&amp;quot; || !url) {
    throw new TypeError(&amp;quot;url must be a non-empty URL string&amp;quot;);
  }
  const parsedUrl = new URL(url);
  if (![&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;].includes(parsedUrl.protocol)) {
    throw new TypeError(&amp;quot;url must use HTTP or HTTPS&amp;quot;);
  }
  const responseJsonSchema = buildSpecSchema(requiredFields);

  const apiKey = process.env.GEMINI_API_KEY;
  if (!apiKey) {
    throw new Error(&amp;quot;GEMINI_API_KEY is missing from the process environment&amp;quot;);
  }
  const ai = new GoogleGenAI({ apiKey });

  const pageResponse = await fetch(parsedUrl, {
    headers: { &amp;quot;User-Agent&amp;quot;: BROWSER_USER_AGENT },
  });
  if (!pageResponse.ok) {
    throw new Error(
      `Failed to fetch ${parsedUrl.href}: ${pageResponse.status} ${pageResponse.statusText}`,
    );
  }
  const html = await pageResponse.text();
  const template = await readFile(new URL(&amp;quot;./plan.md&amp;quot;, import.meta.url), &amp;quot;utf8&amp;quot;);
  const prompt = renderPrompt(template, { requiredFields, url: parsedUrl.href, html });

  const result = await ai.models.generateContent({
    model: MODEL,
    contents: prompt,
    config: {
      responseMimeType: &amp;quot;application/json&amp;quot;,
      responseJsonSchema,
    },
  });
  const text = result.text;
  if (!text) {
    throw new Error(&amp;quot;Gemini API returned no generated JSON content&amp;quot;);
  }
  return JSON.parse(text);
}

// CLI entry point
if (process.argv[1] &amp;amp;&amp;amp; import.meta.url === pathToFileURL(process.argv[1]).href) {
  const [url] = process.argv.slice(2);
  if (!url) {
    console.error(&amp;quot;Please provide a URL. Usage: node generate.mjs &amp;lt;url&amp;gt;&amp;quot;);
    process.exitCode = 1;
  } else {
    const spec = await generateSpec(url);
    console.log(JSON.stringify(spec, null, 2));
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It takes a URL at the CLI and then starts processing on it with &lt;code&gt;generateSpec&lt;/code&gt;. This function does a bit of error checking and then moves on to generating the schema. &lt;code&gt;buildSpecSchema&lt;/code&gt; is used to generate that JSON schema and it&apos;s what&apos;s eventually passed to Google&apos;s Gemini API. I built this script with my AI agent and honestly, this part feels a bit over-engineered, but it gives you an idea of what it&apos;s asking of the API when parsing.&lt;/p&gt;
&lt;p&gt;The function fetches the web page and grabs the text. It then reads &lt;code&gt;plan.md&lt;/code&gt; which is a template for the prompt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;You generate extraction specs that a fixed interpreter will run against HTML pages
to turn a list of items (articles, products, posts) into structured records. You
do not write code. You output one JSON object and nothing else.

## Spec format

{
  &amp;quot;item&amp;quot;:     CSS selector matching each repeated item container,
  &amp;quot;dedupe&amp;quot;:   name of the field used to drop duplicates (usually &amp;quot;link&amp;quot;),
  &amp;quot;minItems&amp;quot;: minimum number of items a healthy page should yield,
  &amp;quot;fields&amp;quot;: {
    &amp;quot;&amp;lt;name&amp;gt;&amp;quot;: {
      &amp;quot;sel&amp;quot;:    optional CSS selector, relative to the item; first match is used
                (omit to use the item element itself),
      &amp;quot;attr&amp;quot;:   optional attribute to read; omit to read the element&apos;s text,
      &amp;quot;match&amp;quot;:  optional JavaScript regex with capture groups, applied to the value,
      &amp;quot;format&amp;quot;: output template for the regex groups, e.g. &amp;quot;$1-$2-$3&amp;quot;
                (required if &amp;quot;match&amp;quot; is present),
      &amp;quot;base&amp;quot;:   optional URL prefix, prepended when the value starts with &amp;quot;/&amp;quot;
    }
  }
}

The interpreter normalizes whitespace, takes the first match of &amp;quot;sel&amp;quot;, and returns
an empty string when something is not found. It supports nothing beyond this format.

## Required fields

Produce these fields: {{REQUIRED_FIELDS, e.g. title, link, date}}.

## Rules

1. Selectors must match the HTML I give you. Do not guess at class names or
   attributes that do not appear in it.
2. Prefer stable hooks over styling hooks: data-* attributes, semantic elements,
   and URL patterns beat generated or layout-specific class names.
3. &amp;quot;item&amp;quot; must select exactly one element per distinct item, not the page&apos;s
   navigation, footers, or ad modules. If the same item appears in several
   modules, that is fine because &amp;quot;dedupe&amp;quot; handles it.
4. If a field is not present as text or an attribute but is encoded elsewhere
   (for example a date inside the URL path), extract it with &amp;quot;match&amp;quot;/&amp;quot;format&amp;quot;
   from the attribute that contains it.
5. Keep regexes simple and anchored to literal context, with no nested
   quantifiers, to keep them fast.
6. Set &amp;quot;minItems&amp;quot; to roughly half the number of items you can identify in the
   sample, so it flags a broken page without being brittle.
7. Do not invent fields I did not ask for.

## Output

Return only the JSON object, with no markdown fences and no commentary.
If the page has no repeated item list that can satisfy the required fields,
return {&amp;quot;error&amp;quot;: &amp;quot;&amp;lt;one-sentence reason&amp;gt;&amp;quot;}.

## Page

URL: {{URL}}

HTML:
{{HTML}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That itself is also updated (see &lt;code&gt;renderPrompt&lt;/code&gt;) and finally it&apos;s passed to Gemini. Whew. So how well did it work?&lt;/p&gt;
&lt;p&gt;I first tried CNN, and it worked mostly ok:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;item&amp;quot;: &amp;quot;li[data-open-link]&amp;quot;,
  &amp;quot;dedupe&amp;quot;: &amp;quot;link&amp;quot;,
  &amp;quot;minItems&amp;quot;: 10,
  &amp;quot;fields&amp;quot;: {
    &amp;quot;title&amp;quot;: { &amp;quot;sel&amp;quot;: &amp;quot;.container__headline-text&amp;quot; },
    &amp;quot;link&amp;quot;: { &amp;quot;attr&amp;quot;: &amp;quot;data-open-link&amp;quot;, &amp;quot;base&amp;quot;: &amp;quot;https://www.cnn.com&amp;quot; },
    &amp;quot;date&amp;quot;: {
      &amp;quot;attr&amp;quot;: &amp;quot;data-open-link&amp;quot;,
      &amp;quot;match&amp;quot;: &amp;quot;/(\\d{4})/(\\d{2})/(\\d{2})/&amp;quot;,
      &amp;quot;format&amp;quot;: &amp;quot;$1-$2-$3&amp;quot;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You&apos;ll notice it has values for date, but it&apos;s never able to get dates as CNN doesn&apos;t actually have dates by all of their stories.&lt;/p&gt;
&lt;p&gt;My blog, which has a proper RSS feed of course, returned:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;item&amp;quot;: &amp;quot;article.post-card&amp;quot;,
  &amp;quot;dedupe&amp;quot;: &amp;quot;link&amp;quot;,
  &amp;quot;minItems&amp;quot;: 3,
  &amp;quot;fields&amp;quot;: {
    &amp;quot;title&amp;quot;: {
      &amp;quot;sel&amp;quot;: &amp;quot;h2 a&amp;quot;
    },
    &amp;quot;link&amp;quot;: {
      &amp;quot;sel&amp;quot;: &amp;quot;h2 a&amp;quot;,
      &amp;quot;attr&amp;quot;: &amp;quot;href&amp;quot;,
      &amp;quot;base&amp;quot;: &amp;quot;https://www.raymondcamden.com&amp;quot;
    },
    &amp;quot;date&amp;quot;: {
      &amp;quot;sel&amp;quot;: &amp;quot;time&amp;quot;,
      &amp;quot;attr&amp;quot;: &amp;quot;datetime&amp;quot;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And as a third example, I parsed the GitHub page showing &lt;a href=&quot;https://github.com/cfjedimaster?tab=repositories&quot;&gt;my repos&lt;/a&gt; (which GitHub has APIs for and such, so definitely not needed), and got this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;item&amp;quot;: &amp;quot;li[itemprop=\&amp;quot;owns\&amp;quot;]&amp;quot;,
  &amp;quot;dedupe&amp;quot;: &amp;quot;link&amp;quot;,
  &amp;quot;minItems&amp;quot;: 15,
  &amp;quot;fields&amp;quot;: {
    &amp;quot;title&amp;quot;: {
      &amp;quot;sel&amp;quot;: &amp;quot;a[itemprop=\&amp;quot;name codeRepository\&amp;quot;]&amp;quot;
    },
    &amp;quot;link&amp;quot;: {
      &amp;quot;sel&amp;quot;: &amp;quot;a[itemprop=\&amp;quot;name codeRepository\&amp;quot;]&amp;quot;,
      &amp;quot;attr&amp;quot;: &amp;quot;href&amp;quot;,
      &amp;quot;base&amp;quot;: &amp;quot;https://github.com&amp;quot;
    },
    &amp;quot;date&amp;quot;: {
      &amp;quot;sel&amp;quot;: &amp;quot;relative-time&amp;quot;,
      &amp;quot;attr&amp;quot;: &amp;quot;datetime&amp;quot;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;the-data-scraper&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#the-data-scraper&quot;&gt;The Data Scraper&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Ok, so as I mentioned, the next part is just &amp;quot;dumb&amp;quot; parsing. My script is called &lt;code&gt;extract.mjs&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;// Usage: node extract.mjs cnn.spec.json https://example.com/
// Requires: npm install cheerio   (Node 18+ for global fetch)
import * as cheerio from &amp;quot;cheerio&amp;quot;;
import { readFile } from &amp;quot;node:fs/promises&amp;quot;;

const BROWSER_USER_AGENT =
  &amp;quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36&amp;quot;;

function readField($el, f) {
  const $t = f.sel ? $el.find(f.sel).first() : $el;
  let v = f.attr ? $t.attr(f.attr) : $t.text();
  v = (v ?? &amp;quot;&amp;quot;).replace(/\s+/g, &amp;quot; &amp;quot;).trim();
  if (f.match) {
    const m = v.match(new RegExp(f.match));
    v = m &amp;amp;&amp;amp; f.format ? f.format.replace(/\$(\d)/g, (_, i) =&amp;gt; m[i] ?? &amp;quot;&amp;quot;) : &amp;quot;&amp;quot;;
  }
  if (f.base &amp;amp;&amp;amp; v.startsWith(&amp;quot;/&amp;quot;)) v = f.base + v;
  return v;
}

export function extract(html, spec) {
  const $ = cheerio.load(html);
  const seen = new Set();
  const items = [];
  $(spec.item).each((_, el) =&amp;gt; {
    const row = {};
    for (const [name, f] of Object.entries(spec.fields)) row[name] = readField($(el), f);
    const key = row[spec.dedupe ?? &amp;quot;link&amp;quot;];
    if (!key || seen.has(key)) return;
    seen.add(key);
    items.push(row);
  });
  return items;
}

// The cheap check that decides whether the agent needs to regenerate the spec.
export function check(items, spec) {
  if (items.length &amp;lt; (spec.minItems ?? 1)) return false;
  const complete = items.filter((r) =&amp;gt; Object.values(r).every(Boolean));
  /*
  console.log(&apos;complete&apos;, complete.length);
  return complete.length / items.length &amp;gt;= 0.9;
  So the original logic was - most of the results need to be complete - i&apos;d say
  as long as complete &amp;gt;= minItems, we are ok
  */
 return complete.length &amp;gt;= (spec.minItems ?? 1);
}

if (import.meta.url === `file://${process.argv[1]}`) {
  const [specPath, url] = process.argv.slice(2);
  if (!specPath || !url) {
    console.error(&amp;quot;Usage: node extract.mjs &amp;lt;spec-path&amp;gt; &amp;lt;url&amp;gt;&amp;quot;);
    process.exit(1);
  }

  const spec = JSON.parse(await readFile(specPath, &amp;quot;utf8&amp;quot;));
  const response = await fetch(url, {
    headers: { &amp;quot;User-Agent&amp;quot;: BROWSER_USER_AGENT },
  });
  if (!response.ok) {
    throw new Error(`Failed to fetch ${url}: ${response.status} ${response.statusText}`);
  }
  const html = await response.text();
  const items = extract(html, spec);
  console.log(JSON.stringify(items, null, 2));
  if (!check(items, spec)) {
    console.error(&amp;quot;SANITY CHECK FAILED: spec likely needs regenerating&amp;quot;);
    process.exit(1);
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Basically - grab the bits and use &lt;a href=&quot;https://www.npmjs.com/package/cheerio&quot;&gt;Cheerio&lt;/a&gt; to parse it using the selectors from the specification JSON.&lt;/p&gt;
&lt;p&gt;How well did it work? First is CNN. I was wrong in terms of dates - sometimes it &lt;em&gt;did&lt;/em&gt; find it. Also, the result set was &lt;em&gt;huge&lt;/em&gt;, but from what I can see, accurate. I removed some from the output below just to keep things sane:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;[
  {
    &amp;quot;title&amp;quot;: &amp;quot;CNN Headlines&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/watch&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Watch CNN’s coverage and analysis after historic election&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/watch/cnn-stream&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;CNN’s John King listens to voters’ reactions to midterm results&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/videos/title-2599145?episode=2599155&amp;amp;source=subwall:vod:episode-2599155&amp;amp;iid=related-embed_streaming-now&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;And for everyone asking: the polls were right&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/videos/title-2572883?episode=2601600&amp;amp;source=subwall:vod:episode-2601600&amp;amp;iid=related-embed_streaming-now&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Your phone is now a casino. What’s it doing to your brain?&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/videos/title-2585292?episode=2585332&amp;amp;source=subwall:vod:episode-2585332&amp;amp;iid=related-embed_streaming-now&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Interactive Q&amp;amp;A: What does the blue wave mean?&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/videos/title-2586772?episode=2586791&amp;amp;source=subwall:vod:episode-2586791&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;What Democrats can now do to stop Trump&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/videos/title-2573118?episode=2601417&amp;amp;source=subwall:vod:episode-2601417&amp;amp;iid=related-embed_streaming-now&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Democrats to have their largest House majority since the 2008 election&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/live-news/midterm-election-congress&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Republicans quickly turn against Pete Hegseth after midterms rout&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/pete-hegseth-impeachment-trump&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Democratic socialist Nithya Raman will defeat Karen Bass in LA mayor’s race, CNN projects&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/nithya-raman-los-angeles-mayor-karen-bass&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;El-Sayed on Vice President Vance&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/el-sayed-vance-trump-midterm-loss-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;19-year-old unseats longtime Republican lawmaker&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/19-year-old-wins-seat-in-massachusetts-state-house-ldn-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Ted Cruz on GOP’s midterm losses&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/ted-cruz-podcast-reaction-midterm-election-vrtc-ldn-digvid&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Why Alaska Senate race could take a while&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/why-the-alaska-senate-race-could-take-a-while-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Mamdani reacts to El-Sayed win&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/mamdani-on-el-sayed-win-ldn-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Voters disappointed with Congress, says DeSantis&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/desantis-says-voters-were-disappointed-with-congresss-productivity-digvid-vrtc-hnk&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Sen. Kelly: ‘Hegseth has been a disaster’&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/world/video/how-democrats-plan-to-end-the-war-in-iran-in-january-hnk-dig-vid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Is the MAGA era over?&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/trump-maga-era-after-midterm-elections-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;What’s next in Mississippi?&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/dispatch-from-mississippi-vv&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Mamdani on Americans rebuking Trump admin&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/mamdani-on-americans-rebuking-trump-administration-midterms-digvid-vrtc-hnk&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Sen.-elect Annie Andrews joins CNN after big win&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/people-are-tired-sen-elect-annie-andrews-joins-cnn-after-big-win-hnk-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;‘Woke is so back’: The internet buzzes with memes after blue wave&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/woke-is-so-back-the-internet-buzzes-with-memes-after-blue-wave-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Bryon Donalds says GOP must focus on lowering costs&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/05/politics/video/florida-governor-elect-says-gop-must-focus-on-lowering-costs-digvid-vrtc-hnk&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;KLB will be governor where her ancestors were enslaved&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/keisha-lance-bottoms-governor-ancestors-enslaved-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;MAGA accepts election losses, but not happily&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/midterms-maga-media-reaction-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Jeffries, Schumer team up&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/democrats-jeffries-schumer-agenda-trump-manu-raju-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Talarico says he is ready to work with Trump&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/border-security-democrat-james-talarico-erin-burnett-vrtc-digvid&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Blue wave hits South Carolina&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/blue-wave-democrats-south-carolina-annie-andrews-darline-graham-midterms-cmm-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Raskin and Crenshaw clash&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/raskin-and-crenshaw-midterms-impeachment-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Trump talks ballroom after election&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/trump-ballroom-construction-election-shellacking-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;DeSantis: ‘Close to an extinction level event’&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/fl-gov-desantis-calls-midterm-results-close-to-an-extinction-level-event-for-the-gop&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;The last time Dems won Kansas&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/no-booze-no-rain-and-the-great-depression-the-last-time-dems-won-in-kansas-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Hakeem Jeffries on Dems’ win&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/jeffries-press-conference-massive-win-digvid&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Trump speaks after GOP losses&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/trump-ballroom-construction-democrats-win-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Jeffries on blue wave and MAGA&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/jeffries-says-ending-iran-war-will-be-top-of-house-democrats-agenda&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Politico cold calls Trump&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/politico-phone-call-donald-trump-midterm-election-vrtc-ldn-digvid&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Dems celebrate gains in speeches&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/democrats-historic-wins-celebration-speech-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Texans revel in state’s flip to blue&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/texans-go-honking-to-celebrate-state-turning-blue&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Midterms bring historic firsts&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.cnn.com/2026/11/04/politics/video/candidates-who-made-history-digvid-vrtc&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-04&amp;quot;
  }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, my blog, which again doesn&apos;t &lt;em&gt;need&lt;/em&gt; this, but was a useful test:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;[
  {
    &amp;quot;title&amp;quot;: &amp;quot;Links For You (11/1/26)&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.raymondcamden.com/2026/11/01/links-for-you-11126&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-01&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Generating PDF Invoices from Word Templates with officeParser&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.raymondcamden.com/2026/10/27/generating-pdf-invoices-from-word-templates-with-officeparser&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-27&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Building the Unicorn-themed app of my dreams with TinyJS&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.raymondcamden.com/2026/10/23/building-the-unicorn-themed-app-of-my-dreams-with-tinyjs&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-23&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Adding a PDF Display to Eleventy&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.raymondcamden.com/2026/10/21/adding-a-pdf-display-to-eleventy&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-21&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Links For You (10/19/26)&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.raymondcamden.com/2026/10/19/links-for-you-101926&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-19&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;Generating PDFs from Word Templates with officeParser&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://www.raymondcamden.com/2026/10/17/generating-pdfs-from-word-templates-with-officeparser&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-17&amp;quot;
  }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally, my list of repos:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;[
  {
    &amp;quot;title&amp;quot;: &amp;quot;cfjedimaster&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/cfjedimaster&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-05T04:14:28Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;myfamilyallowance&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/myfamilyallowance&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-03T15:15:33Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;raymondcamden2023&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/raymondcamden2023&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-11-02T19:30:22Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;webdemos&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/webdemos&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-27T15:35:23Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;tinyjsdemos&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/tinyjsdemos&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-23T14:36:34Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;typescript-stuff&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/typescript-stuff&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-10-02T17:29:36Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;boxlang-mega-samples&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/boxlang-mega-samples&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-09-04T15:18:14Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;precipradar&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/precipradar&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-08-31T18:42:45Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;lego-screensaver&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/lego-screensaver&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-08-24T21:11:42Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;cursor_python_sdk_cli_demo&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/cursor_python_sdk_cli_demo&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-08-22T16:44:41Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;gemini-ai-preso&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/gemini-ai-preso&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-08-13T18:48:45Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;file-preview&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/file-preview&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-08-12T17:59:01Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;doc_qa&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/doc_qa&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-08-08T22:03:37Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;awesome-public-real-time-datasets&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/awesome-public-real-time-datasets&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-07-28T14:50:23Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;iwatchwatches&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/iwatchwatches&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-07-24T16:18:49Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;oh-shit-the-sun&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/oh-shit-the-sun&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-07-20T21:54:35Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;async-preso&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/async-preso&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-07-16T21:53:18Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;pythondemos&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/pythondemos&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-06-22T17:18:55Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;hermes-agent&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/hermes-agent&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-06-10T18:10:43Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;General-Pipedream-Stuff&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/General-Pipedream-Stuff&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-05-13T21:44:53Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;vite-stuff&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/vite-stuff&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-04-30T14:54:17Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;astro-tests&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/astro-tests&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-03-23T13:31:40Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;astrodocs&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/astrodocs&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-03-23T06:58:38Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;intl-is-your-superhero&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/intl-is-your-superhero&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-03-09T19:50:39Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;coldfusion-social-wrappers&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/coldfusion-social-wrappers&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-02-27T16:20:40Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;ai-testingzone&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/ai-testingzone&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-02-09T21:01:42Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;populate-data-into-webflow-cms&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/populate-data-into-webflow-cms&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-02-02T15:49:46Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;writing&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/writing&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-01-23T14:53:05Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;personalsit.es&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/personalsit.es&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-01-16T14:28:53Z&amp;quot;
  },
  {
    &amp;quot;title&amp;quot;: &amp;quot;js-webflow-api&amp;quot;,
    &amp;quot;link&amp;quot;: &amp;quot;https://github.com/cfjedimaster/js-webflow-api&amp;quot;,
    &amp;quot;date&amp;quot;: &amp;quot;2026-01-08T21:27:07Z&amp;quot;
  }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There ya go. If you want to try this yourself, you can grab the code here: &lt;a href=&quot;https://github.com/cfjedimaster/ai-testingzone/tree/main/rsstest&quot;&gt;https://github.com/cfjedimaster/ai-testingzone/tree/main/rsstest&lt;/a&gt;. You will need to provide your own key of course.&lt;/p&gt;
&lt;p&gt;Before I leave, I do want to touch on what I think is an important aspect of this particular demo, and that is I think it&apos;s sensible to think of cases where you can use AI to build a tool to let you &lt;em&gt;not&lt;/em&gt; use AI in the future. A topic I wrote about earlier this year: &lt;a href=&quot;https://www.raymondcamden.com/2026/06/22/use-ai-to-not-use-ai-as-much&quot;&gt;Use AI to not use AI (as much)&lt;/a&gt;&lt;/p&gt;

                        
                
				</content>

                
                
                <category term="uncategorized" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/11/01/links-for-you-11126</id>
                <title>Links For You (11/1/26)</title>
                <updated>2026-11-01T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/11/01/links-for-you-11126" rel="alternate" type="text/html" title="Links For You (11/1/26)"/>
                <content type="html">
				
                        &lt;p&gt;Happy Sunday, and happy &amp;quot;Saints have a bye week so they can&apos;t lose&amp;quot; day. That may be bitter and I shouldn&apos;t write off their season yet but... maybe next year? Of course, this is just one more kinda crappy thing going on amongst a giant pile of other crappy things so - let&apos;s just get right to the links, shall we?&lt;/p&gt;
&lt;h2 id=&quot;when-job-hunting-turns-into-a-security-lesson&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#when-job-hunting-turns-into-a-security-lesson&quot;&gt;When job hunting turns into a security lesson&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Everyone knows the job market is hell now, and to be honest, hell may be a bit too kind. Now imagine you are considering a job, download a take home test, and discover it&apos;s actually a hack attempt. Appaji C. details the attack here: &lt;a href=&quot;https://citizendot.github.io/articles/fake-job-interview-git-hook-malware/?utm_source=tldrdev&quot;&gt;&amp;quot;I Inspected My Take-Home Interview Project. It Was a Whole Operation.&amp;quot;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Of special note, I love the Halloween theme on his blog. It may be gone by the time you read this, but it&apos;s gorgeous.&lt;/p&gt;
&lt;h2 id=&quot;there&apos;s-an-app-for-that---but-there-shouldn&apos;t-be&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#there&apos;s-an-app-for-that---but-there-shouldn&apos;t-be&quot;&gt;There&apos;s an app for that - but there shouldn&apos;t be&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Next up is a fun little post (and rant) from Dan Q. titled, &lt;a href=&quot;https://danq.me/2026/07/09/your-app-could-have-been-a-webpage/?utm_source=the-index&amp;amp;utm_medium=newsletter&quot;&gt;&amp;quot;Your &apos;App&apos; Could Have Been a Webpage (so I fixed it for you...)&amp;quot;&lt;/a&gt;. Now, this may be hard to believe, but Dan was asked to download an app that was absolutely clearly something that should have been just a web page. Shocker, right? But instead of just complaining about it, Dan went to work to inspect the app and tear out the important information. This then turned into a script he could use to generate his own HTML. More of this, please.&lt;/p&gt;
&lt;h2 id=&quot;modernist-tiles-with-css-grid&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#modernist-tiles-with-css-grid&quot;&gt;Modernist tiles with CSS Grid&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&apos;ve been saying this now for maybe 10 years, but CSS has moved at light speed to the point where &lt;em&gt;anything&lt;/em&gt; seems possible. This is great for everyone. Carmen Ansio created a beautiful tutorial on recreating a modernist tile look using CSS: &lt;a href=&quot;https://www.carmenansio.com/articles/modernist-tiles-css-grid/&quot;&gt;&amp;quot;Modernist tiles with CSS Grid&amp;quot;&lt;/a&gt;. The post goes into detail about the methods used, and has multiple interactive elements that are really well done.&lt;/p&gt;
&lt;p&gt;Credit for this find comes from the excellent &lt;a href=&quot;https://cassidoo.co/newsletter/&quot;&gt;newsletter&lt;/a&gt; by Cassidy Williams.&lt;/p&gt;
&lt;h2 id=&quot;just-for-fun&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#just-for-fun&quot;&gt;Just For Fun&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To be honest, I&apos;m not really feeling fun, so here&apos;s a beautiful and sad song.&lt;/p&gt;
&lt;lite-youtube videoid=&quot;InyT9Gyoz_o&quot; style=&quot;background-image: url(&apos;https://i.ytimg.com/vi/InyT9Gyoz_o/hqdefault.jpg&apos;);&quot;&gt;
  &lt;a href=&quot;https://youtube.com/watch?v=InyT9Gyoz_o&quot; class=&quot;lty-playbtn&quot; title=&quot;Play Video&quot;&gt;
    &lt;span class=&quot;lyt-visually-hidden&quot;&gt;Play Video&lt;/span&gt;
  &lt;/a&gt;
&lt;/lite-youtube&gt;
&lt;script defer src=&quot;https://cdnjs.cloudflare.com/ajax/libs/lite-youtube-embed/0.3.2/lite-yt-embed.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/lite-youtube-embed/0.3.2/lite-yt-embed.css&quot; integrity=&quot;sha512-utq8YFW0J2abvPCECXM0zfICnIVpbEpW4lI5gl01cdJu+Ct3W6GQMszVITXMtBLJunnaTp6bbzk5pheKX2XuXQ==&quot; crossorigin=&quot;anonymous&quot; referrerpolicy=&quot;no-referrer&quot; /&gt;
&lt;p&gt;

                        
                
				</content>

                
                <category term="links4you" />
                
                
                <category term="misc" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/10/27/generating-pdf-invoices-from-word-templates-with-officeparser</id>
                <title>Generating PDF Invoices from Word Templates with officeParser</title>
                <updated>2026-10-27T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/10/27/generating-pdf-invoices-from-word-templates-with-officeparser" rel="alternate" type="text/html" title="Generating PDF Invoices from Word Templates with officeParser"/>
                <content type="html">
				
                        &lt;p&gt;Last week I shared a demo (&lt;a href=&quot;https://www.raymondcamden.com/2026/10/17/generating-pdfs-from-word-templates-with-officeparser%5D&quot;&gt;&amp;quot;Generating PDFs from Word Templates with officeParser&amp;quot;&lt;/a&gt;) that made use of the awesome &lt;a href=&quot;https://officeparser.harshankur.com/&quot;&gt;officeParser&lt;/a&gt; open source library. That demo was a simple &amp;quot;customer report&amp;quot; web app that took custom data and a Word template. Once the form was submitted, the library converted tokens in the Word template to real data and output a PDF. I decided to build another demo using the library, this time on the server with a simple Node.js script.&lt;/p&gt;
&lt;p&gt;As I mentioned previously, this new feature mimics Adobe&apos;s &lt;a href=&quot;https://developer.adobe.com/document-services/docs/overview/document-generation-api/&quot;&gt;Document Generation API&lt;/a&gt;. At the time I wrote my blog post, the library just supported simple transformations. So given `` in your Word template, if you passed a name value of &apos;Ray&apos;, you would see that in the resulting PDF.&lt;/p&gt;
&lt;p&gt;Now the library&apos;s been updated to support:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Conditional logic&lt;/li&gt;
&lt;li&gt;Looping&lt;/li&gt;
&lt;li&gt;Formatting of values&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Basically, and no shade to Adobe (not that I think they care), this open source library replicates the most of the same functionality, on your server, for free.&lt;/p&gt;
&lt;p&gt;Given these new features, I thought a simple &amp;quot;data invoicing system&amp;quot; would be a good demo. The idea being:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have data for invoices, usually in a database, but for me, just a JSON file.&lt;/li&gt;
&lt;li&gt;You have a Word template for the invoice.&lt;/li&gt;
&lt;li&gt;A script combines this together and spits out PDFs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first thing I built was the Word template. I used one of the built-in Word templates and modified it a bit. The screenshot below is from Word&apos;s online viewer which frankly looks pretty jank. In my desktop Word it looked a lot better:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/10/word1.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Word template&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;In this template you can see the simple tokens but also an example of looping in the table using &lt;code&gt;for line in lineItems&lt;/code&gt;. Also note the formatting on the dollar amounts. I could have found a way to get conditionals in, but figured this was interesting enough.&lt;/p&gt;
&lt;p&gt;My raw data is just JSON. Here&apos;s part of the file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;invoices&amp;quot;: [
    {
      &amp;quot;invoiceNumber&amp;quot;: 100,
      &amp;quot;name&amp;quot;: &amp;quot;Ada Lovelace&amp;quot;,
      &amp;quot;email&amp;quot;: &amp;quot;ada@example.com&amp;quot;,
      &amp;quot;lineItems&amp;quot;: [
        {
          &amp;quot;description&amp;quot;: &amp;quot;Consulting&amp;quot;,
          &amp;quot;quantity&amp;quot;: 3,
          &amp;quot;unitCost&amp;quot;: 150
        },
        {
          &amp;quot;description&amp;quot;: &amp;quot;Travel expenses&amp;quot;,
          &amp;quot;quantity&amp;quot;: 1,
          &amp;quot;unitCost&amp;quot;: 48.75
        }
      ]
    },
    {
      &amp;quot;invoiceNumber&amp;quot;: 101,
      &amp;quot;name&amp;quot;: &amp;quot;Grace Hopper&amp;quot;,
      &amp;quot;email&amp;quot;: &amp;quot;grace@example.com&amp;quot;,
      &amp;quot;lineItems&amp;quot;: [
        {
          &amp;quot;description&amp;quot;: &amp;quot;Database review&amp;quot;,
          &amp;quot;quantity&amp;quot;: 2,
          &amp;quot;unitCost&amp;quot;: 225
        }
      ]
    },
    {
      &amp;quot;invoiceNumber&amp;quot;: 102,
      &amp;quot;name&amp;quot;: &amp;quot;Katherine Johnson&amp;quot;,
      &amp;quot;email&amp;quot;: &amp;quot;katherine@example.com&amp;quot;,
      &amp;quot;lineItems&amp;quot;: [
        {
          &amp;quot;description&amp;quot;: &amp;quot;Orbital trajectory analysis&amp;quot;,
          &amp;quot;quantity&amp;quot;: 2,
          &amp;quot;unitCost&amp;quot;: 310
        },
        {
          &amp;quot;description&amp;quot;: &amp;quot;Technical review&amp;quot;,
          &amp;quot;quantity&amp;quot;: 3,
          &amp;quot;unitCost&amp;quot;: 85.5
        },
        {
          &amp;quot;description&amp;quot;: &amp;quot;Project meeting&amp;quot;,
          &amp;quot;quantity&amp;quot;: 1,
          &amp;quot;unitCost&amp;quot;: 120
        }
      ]
    },
    {
      &amp;quot;invoiceNumber&amp;quot;: 103,
      &amp;quot;name&amp;quot;: &amp;quot;Alan Turing&amp;quot;,
      &amp;quot;email&amp;quot;: &amp;quot;alan@example.com&amp;quot;,
      &amp;quot;lineItems&amp;quot;: [
        {
          &amp;quot;description&amp;quot;: &amp;quot;Systems consulting&amp;quot;,
          &amp;quot;quantity&amp;quot;: 4,
          &amp;quot;unitCost&amp;quot;: 175
        },
        {
          &amp;quot;description&amp;quot;: &amp;quot;Prototype review&amp;quot;,
          &amp;quot;quantity&amp;quot;: 2,
          &amp;quot;unitCost&amp;quot;: 240
        },
        {
          &amp;quot;description&amp;quot;: &amp;quot;Documentation&amp;quot;,
          &amp;quot;quantity&amp;quot;: 6,
          &amp;quot;unitCost&amp;quot;: 42.5
        },
        {
          &amp;quot;description&amp;quot;: &amp;quot;Materials&amp;quot;,
          &amp;quot;quantity&amp;quot;: 1,
          &amp;quot;unitCost&amp;quot;: 63.25
        }
      ]
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally, here&apos;s the script that does the processing:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const { readFile, mkdir, writeFile } = require(&apos;node:fs/promises&apos;)
const path = require(&apos;node:path&apos;)
const { OfficeConverter, OfficeTemplate } = require(&apos;officeparser&apos;)

function isRecord(value) {
  return value !== null &amp;amp;&amp;amp; typeof value === &apos;object&apos; &amp;amp;&amp;amp; !Array.isArray(value)
}

function requireText(value, label) {
  if (typeof value !== &apos;string&apos; || value.trim() === &apos;&apos;) {
    throw new Error(`${label} must be a non-empty string.`)
  }

  return value.trim()
}

function toCents(value, label) {
  if (typeof value !== &apos;number&apos; || !Number.isFinite(value) || value &amp;lt; 0) {
    throw new Error(`${label} must be a non-negative number.`)
  }

  const cents = Math.round((value + Number.EPSILON) * 100)
  if (!Number.isSafeInteger(cents)) {
    throw new Error(`${label} is too large to represent as currency.`)
  }

  return cents
}

function buildInvoiceData(json, issuedOn = new Date()) {
  if (!isRecord(json) || !Array.isArray(json.invoices) || json.invoices.length === 0) {
    throw new Error(&apos;The JSON file must contain a non-empty &amp;quot;invoices&amp;quot; array.&apos;)
  }

  const invoiceDate = [
    issuedOn.getFullYear(),
    String(issuedOn.getMonth() + 1).padStart(2, &apos;0&apos;),
    String(issuedOn.getDate()).padStart(2, &apos;0&apos;),
  ].join(&apos;-&apos;)

  return json.invoices.map((invoice, invoiceIndex) =&amp;gt; {
    const invoiceLabel = `Invoice ${invoiceIndex + 1}`
    if (!isRecord(invoice)) {
      throw new Error(`${invoiceLabel} must be an object.`)
    }

    if (!Number.isSafeInteger(invoice.invoiceNumber) || invoice.invoiceNumber &amp;lt;= 0) {
      throw new Error(`${invoiceLabel} invoiceNumber must be a positive whole number.`)
    }

    const recipientName = requireText(invoice.name, `${invoiceLabel} name`)
    const recipientEmail = requireText(invoice.email, `${invoiceLabel} email`)
    if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(recipientEmail)) {
      throw new Error(`${invoiceLabel} email must be a valid email address.`)
    }
    if (!Array.isArray(invoice.lineItems) || invoice.lineItems.length === 0) {
      throw new Error(`${invoiceLabel} must contain at least one line item.`)
    }

    let subtotalCents = 0
    const lineItems = invoice.lineItems.map((item, itemIndex) =&amp;gt; {
      const itemLabel = `${invoiceLabel} line item ${itemIndex + 1}`
      if (!isRecord(item)) {
        throw new Error(`${itemLabel} must be an object.`)
      }

      const description = requireText(item.description, `${itemLabel} description`)
      if (!Number.isSafeInteger(item.quantity) || item.quantity &amp;lt;= 0) {
        throw new Error(`${itemLabel} quantity must be a positive whole number.`)
      }

      const unitCostCents = toCents(item.unitCost, `${itemLabel} unitCost`)
      const lineTotalCents = unitCostCents * item.quantity
      if (!Number.isSafeInteger(lineTotalCents) || !Number.isSafeInteger(subtotalCents + lineTotalCents)) {
        throw new Error(`${itemLabel} total is too large to represent as currency.`)
      }
      subtotalCents += lineTotalCents

      return {
        description,
        quantity: item.quantity,
        unitCost: unitCostCents / 100,
        total: lineTotalCents / 100,
        lineTotal: lineTotalCents / 100,
      }
    })

    const invoiceNumber = String(invoice.invoiceNumber)
    const salesTaxCents = Math.round(subtotalCents / 20)
    const totalCents = subtotalCents + salesTaxCents
    if (!Number.isSafeInteger(totalCents)) {
      throw new Error(`${invoiceLabel} total due is too large to represent as currency.`)
    }

    return {
      invoiceNumber,
      invoiceDate,
      recipientName,
      recipientEmail,
      lineItems,
      subtotal: subtotalCents / 100,
      salesTax: salesTaxCents / 100,
      total: totalCents / 100,
    }
  })
}

function makeFilename(invoice) {
  const customerSlug = invoice.recipientName
    .normalize(&apos;NFKD&apos;)
    .replace(/[\u0300-\u036f]/g, &apos;&apos;)
    .replace(/[^a-z0-9]+/gi, &apos;-&apos;)
    .replace(/^-|-$/g, &apos;&apos;)
    .toLowerCase() || &apos;customer&apos;

  return `${invoice.invoiceNumber.toLowerCase()}-${customerSlug}.pdf`
}

async function generateInvoices(inputPath, outputPath, templatePath) {
  const input = JSON.parse(await readFile(inputPath, &apos;utf8&apos;))
  const invoices = buildInvoiceData(input)
  const template = await readFile(templatePath)

  await mkdir(outputPath, { recursive: true })

  const renderedDocuments = await OfficeTemplate.render(template, {
    data: invoices,
    onMissing: &apos;error&apos;,
  })
  if (!Array.isArray(renderedDocuments) || renderedDocuments.length !== invoices.length) {
    throw new Error(&apos;officeparser did not return one rendered document per invoice.&apos;)
  }

  for (const [index, invoice] of invoices.entries()) {
    const renderedDocx = renderedDocuments[index]
    if (!(renderedDocx instanceof Uint8Array)) {
      throw new Error(`officeparser did not return a rendered document for ${invoice.invoiceNumber}.`)
    }

    const { value: pdfBytes } = await OfficeConverter.convert(renderedDocx, &apos;pdf&apos;, {
      generatorConfig: {
        pdfConfig: { engine: &apos;native&apos; },
      },
    })

    if (!(pdfBytes instanceof Uint8Array)) {
      throw new Error(`officeparser did not return PDF data for ${invoice.invoiceNumber}.`)
    }

    const outputFile = path.join(outputPath, makeFilename(invoice))
    await writeFile(outputFile, pdfBytes)
    console.log(`Created ${outputFile}`)
  }
}

async function main(args) {
  if (args[0] === &apos;--help&apos; || args[0] === &apos;-h&apos;) {
    console.log(&apos;Usage: node script.js [invoices.json] [output-directory]&apos;)
    return
  }
  if (args.length &amp;gt; 2) {
    throw new Error(&apos;Usage: node script.js [invoices.json] [output-directory]&apos;)
  }

  const inputPath = args[0]
    ? path.resolve(args[0])
    : path.join(__dirname, &apos;invoices.json&apos;)
  const outputPath = args[1]
    ? path.resolve(args[1])
    : path.join(__dirname, &apos;output&apos;)
  const templatePath = path.join(__dirname, &apos;invoiceTemplate.docx&apos;)

  await generateInvoices(inputPath, outputPath, templatePath)
}

if (require.main === module) {
  main(process.argv.slice(2)).catch((error) =&amp;gt; {
    console.error(&apos;Invoice generation failed:&apos;, error)
    process.exitCode = 1
  })
}

module.exports = { buildInvoiceData, generateInvoices, makeFilename }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It can be run at the CLI and takes arguments for where the data is and where to write it out - along with basic defaults for each. &lt;code&gt;buildInvoiceData&lt;/code&gt; does the job of mapping the &apos;raw&apos; data to what I need for the operation. This is something I did with Adobe&apos;s APIs as well. Rarely was the source data in a shape that mapped directly to the Word template, so a bit of shaping handles that transformation.&lt;/p&gt;
&lt;p&gt;The officeParser library part is here:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const renderedDocuments = await OfficeTemplate.render(template, {
	data: invoices,
	onMissing: &apos;error&apos;,
})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That second arg is interesting. If the Word template references a value you don&apos;t pass, you can have the library simply ignore it, or throw an error. I like throwing an error as it makes it obvious when you&apos;ve screwed something up.&lt;/p&gt;
&lt;p&gt;After the conversion is done, the bits are all saved out to PDFs using the invoice number and name of the person getting the invoice.&lt;/p&gt;
&lt;p&gt;There&apos;s a bit more to the script above, but the gist is - read the data, shape it, pass it along with the template, save the result.&lt;/p&gt;
&lt;p&gt;Here&apos;s an example of how one looks:&lt;/p&gt;
&lt;div id=&quot;pdf-viewer-1&quot; style=&quot;width: 100%; height: 500px; margin-bottom: 30px&quot;&gt;&lt;/div&gt;
&lt;script type=&quot;module&quot;&gt;
import EmbedPDF, { ZoomMode } from &apos;https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js&apos;;
 
EmbedPDF.init({
	type: &apos;container&apos;,
	target: document.getElementById(&apos;pdf-viewer-1&apos;),
	src: &apos;https://static.raymondcamden.com/images/2026/10/106-radia-perlman.pdf&apos;,
	theme: { preference: &apos;system&apos; },
	disabledCategories: [&apos;annotation&apos;],
	zoom: {
		defaultZoomLevel: ZoomMode.FitWidth
	}
});
&lt;/script&gt;
&lt;p&gt;Pretty cool, right? I mean, we all agree, PDFs are REALLY COOL! Anyway, you can grab all the bits, along with the Word template and sample output here: &lt;a href=&quot;https://github.com/cfjedimaster/webdemos/tree/master/officeparser/invoice&quot;&gt;https://github.com/cfjedimaster/webdemos/tree/master/officeparser/invoice&lt;/a&gt;&lt;/p&gt;

                        
                
				</content>

                
                <category term="javascript" />
                
                
                <category term="development" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/10/23/building-the-unicorn-themed-app-of-my-dreams-with-tinyjs</id>
                <title>Building the Unicorn-themed app of my dreams with TinyJS</title>
                <updated>2026-10-23T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/10/23/building-the-unicorn-themed-app-of-my-dreams-with-tinyjs" rel="alternate" type="text/html" title="Building the Unicorn-themed app of my dreams with TinyJS"/>
                <content type="html">
				
                        &lt;p&gt;Everyone likes to talk about light versus dark theme while no one is addressing the real need for our users - a proper unicorn theme. I mean, take a look at this beauty:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/10/uni1.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Uninote desktop app running&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;This is &lt;a href=&quot;https://github.com/cfjedimaster/tinyjsdemos/tree/main/uninote&quot;&gt;Uninote&lt;/a&gt;, a desktop note taking application that - well - takes notes. You create notebooks, write notes, and that&apos;s it. No AI features. Nothing complex, just a note taking app. I&apos;ve had a love/hate relationship with these apps for years. I was a &lt;em&gt;huge&lt;/em&gt; Evernote fan until it went to poo. I currently use OneNote and... it&apos;s ok but I wish it was better. And yes, before folks chime in with suggestions, I&apos;m aware I&apos;ve got choices, but I &amp;quot;share&amp;quot; note access with my wife so one of the caveats is that I need an app she&apos;s comfortable with and I can deal with as well.&lt;/p&gt;
&lt;p&gt;That being said - &lt;a href=&quot;https://tinyjs.app/index.html&quot;&gt;TinyJS&lt;/a&gt; is a cool as hell platform to build desktop apps and I thought I&apos;d try building a basic note application with it. You can &lt;a href=&quot;https://github.com/cfjedimaster/tinyjsdemos/tree/main/uninote&quot;&gt;peruse&lt;/a&gt; all the code you want, and if you clone the repo and use the CLI, run a build yourself (I don&apos;t have any plans to release a &amp;quot;real&amp;quot; app - maybe) if you want to see it in action. Most of it is &amp;quot;just&amp;quot; HTML, CSS, and JavaScript, so let me share some of the more interesting tidbits.&lt;/p&gt;
&lt;h2 id=&quot;design&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#design&quot;&gt;Design&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before getting into the code, let me talk about the design. I began in Claude and used this prompt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;im building a simple desktop app with TinyJS that is a note taking application, 
like Evernote and OneNote. the app will be called Uninote, and is unicorn 
themed. functionality is pretty simple - you have notebooks that have a name, 
you can add, edit, and remove notebooks. notebooks have notes with a title, 
last edited value, and just a block of text (no support for binary data). it 
should support light/dark mode

can you give me 3 mocks for this - images only if you can, no HTML. as i said, 
its unicorn themed so it should slick, but cute
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let me just say - I greatly appreciate AI tools that can deal with my typos. Claude did a pretty good job with the three mocks it created, but the design you see above was a clear favorite for me. While I love the light version, the dark version is pretty great as well:&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;https://static.raymondcamden.com/images/2026/10/uni2.jpg&quot; loading=&quot;lazy&quot; alt=&quot;Uninote desktop app running - dark theme&quot; class=&quot;imgborder imgcenter&quot;&gt;
&lt;/p&gt;
&lt;p&gt;This blew away most of my daily Claude usage however, so I took it to Copilot in Visual Studio Code to convert the mock to HTML. I forgot to tell it to ignore the desktop UI (ie OSX app frame stuff) so I had to ask it to do that as a followup, but it worked well.&lt;/p&gt;
&lt;p&gt;This was done in a new app scaffolded by the TinyJS CLI. As I mentioned in my &lt;a href=&quot;https://www.raymondcamden.com/2026/10/08/tiny-apps-with-tinyjs&quot;&gt;first post&lt;/a&gt;, you can scaffold an app with Alpine and TypeScript, and Copilot had no issues going from mock to layout with that setup. From there, I basically &amp;quot;rolled back&amp;quot; the mock data into Alpine directives. So for example, my mock had a list of notebooks that I was able to convert to a proper list in Alpine based on data.&lt;/p&gt;
&lt;h2 id=&quot;code&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#code&quot;&gt;Code&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;So most of this is vanilla Alpine type stuff, where the interesting bit comes in is the persistence, which uses SQLite. SQLite access is provided in the &amp;quot;backend&amp;quot; code. You begin with one import:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;import { Database } from &apos;tjs:sqlite&apos;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then handle your database initialization. For me it looks like so:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;let db = null;

export const api = {
  initDB: async () =&amp;gt; {
    db.exec(`
CREATE TABLE IF NOT EXISTS notebooks (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL
);      
     `);

    db.exec(`
CREATE TABLE IF NOT EXISTS notes (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  title TEXT NOT NULL,
  content TEXT NOT NULL,
  notebook_id INTEGER NOT NULL,
  created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (notebook_id) REFERENCES notebooks(id) ON DELETE CASCADE
);      
     `);
    db.exec(&apos;PRAGMA foreign_keys = ON&apos;);

    return true;
  },
  // more stuff
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My database is two simple tables - one for notebooks and one for notes. TinyJS takes any method defined in the &lt;code&gt;api&lt;/code&gt; export and lets you call it from the client. So in my Alpine startup I&apos;ve got:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;async init() {
    await tiny.api.call(&apos;initDB&apos;)
    // more stuff
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The rest of the &apos;CRUD&apos; (Creating, Reading, Updating, Deleting), are just more DB calls. On the front end, I gather the data, pass it to the backend via &lt;code&gt;tiny.api.call&lt;/code&gt;, and write the SQL back there.&lt;/p&gt;
&lt;p&gt;So for example, to just get a list of notebooks:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;// in the front end
this.notebooks = await tiny.api.call(&apos;getNotebooks&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;getNotebooks: async () =&amp;gt; {
if (!db) throw new Error(&apos;Database not initialized. Call initDB first.&apos;);
return db.prepare(`
    SELECT notebooks.id, notebooks.name, COUNT(notes.id) AS noteCount
    FROM notebooks LEFT JOIN notes ON notes.notebook_id = notebooks.id
    GROUP BY notebooks.id ORDER BY notebooks.id
`).all();
},
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&apos;s basically it. Let me share two more little TinyJS bits. To copy to the clipboard, I did not use the usual web platform way, but rather:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;await tiny.clipboard.write({ text: `${note.title}\n\n${note.content}` })
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&apos;m not sure what that offers in contrast to the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Clipboard&quot;&gt;Clipboard API&lt;/a&gt; and will find some time to figure that out.&lt;/p&gt;
&lt;p&gt;The second is a small thing, but super useful. Your TinyJS app has a &apos;controller&apos; JSON file that lets you set a heck of a lot of properties. One of those is the window size:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&amp;quot;size&amp;quot;: &amp;quot;960x640&amp;quot;,
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But out of the box, you can set a default size &lt;em&gt;and&lt;/em&gt; have the app automatically remember the window size and position:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&amp;quot;size&amp;quot;: &amp;quot;960x640&amp;quot;,
&amp;quot;rememberWindows&amp;quot;: true,
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I was convinced I was going to need a &amp;quot;listen for window resize and persist&amp;quot; type logic but nope - one line in JSON. Perfect.&lt;/p&gt;
&lt;p&gt;Photo by &lt;a href=&quot;https://unsplash.com/@anniespratt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText&quot;&gt;Annie Spratt&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/photos/white-and-gold-ceramic-unicorn-figurine-near-coins-Jr8byYZmTTU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

                        
                
				</content>

                
                <category term="javascript" />
                
                
                <category term="development" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/10/21/adding-a-pdf-display-to-eleventy</id>
                <title>Adding a PDF Display to Eleventy</title>
                <updated>2026-10-21T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/10/21/adding-a-pdf-display-to-eleventy" rel="alternate" type="text/html" title="Adding a PDF Display to Eleventy"/>
                <content type="html">
				
                        &lt;p&gt;This will be a short one. I&apos;ve talked about embedding PDFs on web pages for probably close to ten years now. Blame Adobe. Blame me being a nerd and finding this stuff interesting. Blame whoever. While I&apos;ve blogged about the topic, I&apos;ve also actually done that on my site here, in a variety of different ways.&lt;/p&gt;
&lt;p&gt;A while back I realized I wasn&apos;t being consistent with how I did... &amp;quot;stuff&amp;quot; here, like call outs, Youtube links, etc. I started a &lt;a href=&quot;https://github.com/cfjedimaster/raymondcamden2023/blob/main/guide.md&quot;&gt;guide doc&lt;/a&gt; so I&apos;d have a quick way to remember what I did last time, and be more consistent.&lt;/p&gt;
&lt;p&gt;One item on there I had left as &amp;quot;figure it out later&amp;quot; was proper PDF embedding. This week I finally nailed that down. &lt;a href=&quot;https://www.embedpdf.com/&quot;&gt;EmbedPDF&lt;/a&gt; is a library I&apos;ve mentioned here before so I leaned on it, and went with an incredibly simple snippet:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;div id=&amp;quot;pdf-dis&amp;quot; style=&amp;quot;width: 100%; height: 400px; margin-bottom: 30px&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
 
&amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;
import EmbedPDF, { ZoomMode } from &apos;https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js&apos;;
 
EmbedPDF.init({
	type: &apos;container&apos;,
	target: document.getElementById(&apos;pdf-dis&apos;),
	src: &apos;https:// ....&apos;,
	theme: { preference: &apos;system&apos; },
	disabledCategories: [&apos;annotation&apos;],
	zoom: {
		defaultZoomLevel: ZoomMode.FitWidth
	}
});
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This does a few things that make sense on my blog, and may not for you. I use the &lt;code&gt;ZoomMode&lt;/code&gt; feature to make the PDF document automatically be as wide as the container. Honestly, I don&apos;t know why this isn&apos;t the default, but given that PDFs can specify their own default view, the library may just usually let it decide. The rest of the code is pretty much vanilla from the docs.&lt;/p&gt;
&lt;p&gt;So that&apos;s the snippet. To make it a shortcode in Eleventy, I added this to my page which defines all the shortcodes for my blog:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const embedPDF = (id, url, height=&amp;quot;500px&amp;quot;) =&amp;gt; {
  return `
&amp;lt;div id=&amp;quot;${id}&amp;quot; style=&amp;quot;width: 100%; height: ${height}; margin-bottom: 30px&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
 
&amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;
import EmbedPDF, { ZoomMode } from &apos;https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js&apos;;
 
EmbedPDF.init({
	type: &apos;container&apos;,
	target: document.getElementById(&apos;${id}&apos;),
	src: &apos;${url}&apos;,
	theme: { preference: &apos;system&apos; },
	disabledCategories: [&apos;annotation&apos;],
	zoom: {
		defaultZoomLevel: ZoomMode.FitWidth
	}
});
&amp;lt;/script&amp;gt;
  `;
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gets loaded by my Eleventy config script and inside a post, I can:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{% embedPDF &amp;quot;pdf-viewer-1&amp;quot;, &amp;quot;https://static.raymondcamden.com/assets/document.pdf&amp;quot; %}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which gives you:&lt;/p&gt;
&lt;div id=&quot;pdf-viewer-1&quot; style=&quot;width: 100%; height: 500px; margin-bottom: 30px&quot;&gt;&lt;/div&gt;
&lt;script type=&quot;module&quot;&gt;
import EmbedPDF, { ZoomMode } from &apos;https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js&apos;;
 
EmbedPDF.init({
	type: &apos;container&apos;,
	target: document.getElementById(&apos;pdf-viewer-1&apos;),
	src: &apos;https://static.raymondcamden.com/assets/document.pdf&apos;,
	theme: { preference: &apos;system&apos; },
	disabledCategories: [&apos;annotation&apos;],
	zoom: {
		defaultZoomLevel: ZoomMode.FitWidth
	}
});
&lt;/script&gt;
&lt;p&gt;I found this useful, and I hope you do too.&lt;/p&gt;

                        
                
				</content>

                
                <category term="eleventy" />
                
                
                <category term="jamstack" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
            <entry>
                <id>https://www.raymondcamden.com/2026/10/19/links-for-you-101926</id>
                <title>Links For You (10/19/26)</title>
                <updated>2026-10-19T18:00:00+00:00</updated>
                <link href="https://www.raymondcamden.com/2026/10/19/links-for-you-101926" rel="alternate" type="text/html" title="Links For You (10/19/26)"/>
                <content type="html">
				
                        &lt;p&gt;Wowza - I&apos;m like nearly a month late on this. This is where I&apos;d try to come up with a good excuse, but I think if I just randomly point around at things and said... &amp;quot;life&amp;quot; most of you would completely understand where I&apos;m coming from. It&apos;s been a difficult few months for myself, and for nearly every person I know. This week I&apos;m going to try focus on the positive and the things that make me smile, and I hope all my lovely readers can do the same!&lt;/p&gt;
&lt;h2 id=&quot;make-music%2C-not-war&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#make-music%2C-not-war&quot;&gt;Make Music, Not War&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;First up is the appropriately named &lt;a href=&quot;https://hyperblam.how/&quot;&gt;Hyperblam&lt;/a&gt;, a music making tool that lets you use a declarative language to create sick beats as the kids say. What does that look like? Here&apos;s one example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;!-- bus! (master signal chain) --&amp;gt;
&amp;lt;chain-blam id=&amp;quot;bus&amp;quot;&amp;gt;
&amp;lt;gain-blam id=&amp;quot;bits&amp;quot; gain=&amp;quot;0.25&amp;quot; bypass&amp;gt;
    &amp;lt;lfo-blam type=&amp;quot;square&amp;quot; beats=&amp;quot;0.001&amp;quot; prop=&amp;quot;gain&amp;quot; gain=&amp;quot;0.25&amp;quot;&amp;gt;
    &amp;lt;blam-blam from=&amp;quot;#kick&amp;quot; prop=&amp;quot;beats&amp;quot; value=&amp;quot;0.001~0.003&amp;quot; chance=&amp;quot;0.3&amp;quot;&amp;gt;&amp;lt;/blam-blam&amp;gt;
    &amp;lt;/lfo-blam&amp;gt;
&amp;lt;/gain-blam&amp;gt;
&amp;lt;phaser-blam id=&amp;quot;swoosh&amp;quot; center=&amp;quot;6000&amp;quot; depth=&amp;quot;4000&amp;quot; q=&amp;quot;0.5&amp;quot; bypass&amp;gt;&amp;lt;/phaser-blam&amp;gt;
&amp;lt;analyser-blam id=&amp;quot;analyser&amp;quot; smoothing=&amp;quot;0.6&amp;quot;&amp;gt;&amp;lt;/analyser-blam&amp;gt;
&amp;lt;/chain-blam&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And you can play the song this is a part of here:&lt;/p&gt;
&lt;p class=&quot;codepen&quot; data-theme-id=&quot;-2&quot; data-height=&quot;500&quot; data-pen-title=&quot;HYPERBLAM (HELLO HYPERBLAM)&quot; data-preview=&quot;true&quot; data-default-tab=&quot;result&quot; data-slug-hash=&quot;RNKgMEe&quot; data-user=&quot;heydon&quot; style=&quot;height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&quot;&gt;
  &lt;span&gt;See the Pen &lt;a href=&quot;https://codepen.io/heydon/pen/RNKgMEe&quot;&gt;
  HYPERBLAM (HELLO HYPERBLAM)&lt;/a&gt; by Heydon (&lt;a href=&quot;https://codepen.io/heydon&quot;&gt;@heydon&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;script async src=&quot;https://public.codepenassets.com/embed/index.js&quot;&gt;&lt;/script&gt;
&lt;h2 id=&quot;this-ui-library-will-make-you-jelly...&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#this-ui-library-will-make-you-jelly...&quot;&gt;This UI library will make you jelly...&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Jelly as in jealous - and again - that&apos;s what the kids say, right? &lt;a href=&quot;https://jelly-ui.com/&quot;&gt;Jelly UI&lt;/a&gt; is a UI web component library for &amp;quot;jelly&amp;quot; type interfaces. Think fat, but soft, bright colors and such. I love web components for libraries like this, and this one is on my list to try soon in a demo.&lt;/p&gt;
&lt;p&gt;I copied a few samples from their docs and threw it in a CodePen:&lt;/p&gt;
&lt;p class=&quot;codepen&quot; data-theme-id=&quot;-2&quot; data-height=&quot;500&quot; data-pen-title=&quot;Jelly UI&quot; data-preview=&quot;true&quot; data-version=&quot;2&quot; data-default-tab=&quot;result&quot; data-slug-hash=&quot;azJGPMW&quot; data-user=&quot;cfjedimaster&quot; style=&quot;height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&quot;&gt;
  &lt;span&gt;See the Pen &lt;a href=&quot;https://codepen.io/editor/cfjedimaster/pen/01a15441-9c56-7fc4-beda-0c7c391a2e01&quot;&gt;
  Jelly UI&lt;/a&gt; by Raymond Camden (&lt;a href=&quot;https://codepen.io/cfjedimaster&quot;&gt;@cfjedimaster&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;script async src=&quot;https://public.codepenassets.com/embed/index.js&quot;&gt;&lt;/script&gt;
&lt;h2 id=&quot;your-new-rss-feed-reader&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#your-new-rss-feed-reader&quot;&gt;Your new RSS Feed Reader&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Last but definitely not least is an incredible new product from my buddy &lt;a href=&quot;https://kisdigital.com/&quot;&gt;Robert&lt;/a&gt; - &lt;a href=&quot;https://feedhouse.app/&quot;&gt;Feedhouse&lt;/a&gt; is an RSS reader, but with so many features it goes far beyond just RSS parsing. It has great social aspects (you can mark up and comment on items in your feed, you can share collections of feeds), it supports sites without RSS feeds, it lets you sign up for newsletters with a custom address and automatically parse the items into your feed, and so much more. If you want to learn more about how it&apos;s built, Robert wrote up a great post on it: &lt;a href=&quot;https://kisdigital.com/posts/2026/10/everything-feedhouse-does-from-the-boring-parts-up&quot;&gt;Everything Feedhouse Does, From the Boring Parts Up&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;just-for-fun&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#just-for-fun&quot;&gt;Just For Fun&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;My readers know I&apos;m a huge fan of covers and imagine my surprise when I discovered this one by School of Seven Bells... enjoy!&lt;/p&gt;
&lt;lite-youtube videoid=&quot;bQlVb4ffhCs&quot; style=&quot;background-image: url(&apos;https://i.ytimg.com/vi/bQlVb4ffhCs/hqdefault.jpg&apos;);&quot;&gt;
  &lt;a href=&quot;https://youtube.com/watch?v=bQlVb4ffhCs&quot; class=&quot;lty-playbtn&quot; title=&quot;Play Video&quot;&gt;
    &lt;span class=&quot;lyt-visually-hidden&quot;&gt;Play Video&lt;/span&gt;
  &lt;/a&gt;
&lt;/lite-youtube&gt;
&lt;script defer src=&quot;https://cdnjs.cloudflare.com/ajax/libs/lite-youtube-embed/0.3.2/lite-yt-embed.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/lite-youtube-embed/0.3.2/lite-yt-embed.css&quot; integrity=&quot;sha512-utq8YFW0J2abvPCECXM0zfICnIVpbEpW4lI5gl01cdJu+Ct3W6GQMszVITXMtBLJunnaTp6bbzk5pheKX2XuXQ==&quot; crossorigin=&quot;anonymous&quot; referrerpolicy=&quot;no-referrer&quot; /&gt;
&lt;p&gt;

                        
                
				</content>

                
                <category term="links4you" />
                
                
                <category term="misc" />
                
                <author>
                    <name>Raymond Camden</name>
                    <email>raymondcamden@gmail.com</email>
                </author>
            </entry>
        
</feed>