Texting Email Summaries using Google PaLM AI and Twilio

Yesterday I shared my initial impressions of working with Google’s PaLM 2 AI API. If you didn’t read that article, the tldr is that it’s incredibly easy to work with and I was able to get some Node.js code running in minutes. Exactly the kind of experience you want new developers to have with your product. Based on how easy it was to do that, I thought about building a real prototype of how the service could be used. What It Does # My simple prototype is based on the idea of handling an influx of emails. Imagine a support address or other important email address used for a company. If there is a lot of email coming in, or if the emails that do come in are critically important,... more →
Posted in: JavaScript

Using Goodreads Data in Eleventy

I’ve been a Goodreads user for a few years now, and much like how I use other ‘tracking’ services, I’m not there for other folks’ reading lists or recommendations, but instead, as a way to track what I’ve read. I especially like looking back over the past year and being reminded of the books I really enjoyed. Recently, myself and others were talking on Mastodon about how to work with this kind of data, other services, and so forth. Goodreads does not have an API unfortunately (it used to, but it shut it down) but they do let you export your data. I decided to take a look at this and see if (and how) it could be used in Eleventy. Here’s what I found. Edit... more →
Posted in: JavaScript

Quick example using AWS Node.js SDK V3 for Signed URLs

This probably falls into the "it was easy for everyone else in the world but me" bucket, but I really struggled to find good search results for this and figured I’d better write it down so when I google for it again in a few months, I’ll find my own blog. Specifically – today I was trying to use the AWS Node.js SDK to generate signed URLs. One to create read-only access to a bucket item and another to allow uploading. Everything I’m sharing is covered in the docs, but I struggled to find the relevant parts. So first off, V3 of the SDK is modularized, so instead of installing a giant SDK, you get just what you need. A lot of the demos show S3 so that’s handy.... more →
Posted in: JavaScript

Using Goodreads Data in Eleventy – Update

Yesterday I shared a blog post where I detailed how to take your data export from Goodreads and make use of it in an Eleventy site. While describing the process, I mentioned that I wasn’t terribly confident in the approach. Things got even worse when I tried to make use of the Google Books API as well. (That’s not the fault of the API, more just an issue with how Goodreads reported book titles.) Well, today, Brian Koser reached out and pointed out a much easier way to accomplish the same thing. To be honest, I love it when I say something and folks point out a way to make it better – it’s like free content for my blog! Anyway, here’s what Brian shared. Turns out,... more →
Posted in: JavaScript

Using the Cookie Store API

Today while browsing a list of web APIs over at MDN, I ran across one that surprised me – the Cookie Store API. This is clearly marked as experimental (currently only supported in Chrome/Edge) but looks to be fascinating. Cookies are the oldest (as far as I know) way for web applications to store data on the client. They’re also typically the least recommended way of doing so, for many, many reasons. However, sometimes you need to work with cookies, and this looks like a really nice new way of dealing with them. Here’s a quick look. The Old Way # For the past few hundred years or so, working with cookies in the browser involved string parsing. There really wasn’t even... more →
Posted in: JavaScript

Detect System Theme Preference Change Using JavaScript

JavaScript and CSS allow users to detect the user theme preference with CSS’ prefers-color-scheme media query. It’s standard these days to use that preference to show the dark or light theme on a given website. But what if the user changes their preference while using your app? To detect a system theme preference change using JavaScript, you need to combine matchMedia, prefers-color-scheme, and an event listener: window.matchMedia('(prefers-color-scheme: dark)') .addEventListener('change',({ matches }) ={ if (matches) { console.log("change to dark mode!") } else { console.log("change to light mode!") } }) The change event of the matchMedia API notifies you... more →
Posted in: JavaScript

Using the Adobe PDF EMbed API with Vue 3

A long time ago, ok, February of last year, I posted about using the Adobe PDF Embed library with Vue.js: Using the PDF Embed API with Vue.js. The main issue with our Embed library and libraries like Vue is a "chicken and egg" issue. Basically, our docs tell you to add an event listener for our library to load, but it’s possible that the library has loaded before you add the event listener. Raymond Camden… more →
Posted in: JavaScript

Using Google Maps with Alpine.js

It’s been a little while since I’ve blogged about Alpine.js, and I thought an example of integratingGoogle Maps with it would be a good way to continue my path to becoming comfortable with the framework. I imagined it would be fairly simple, but in building a few demos I ran into some interesting issues that helped me learn a bit more about Alpine. Let’s take a look. Raymond Camden… more →
Posted in: JavaScript
1 2 3 4 5 6