Using Cloudflare’s Browser Rendering APIs for Screenshots

I’ve been a Cloudflare fan for a while now, but have mainly focused on their Workers Serverless platform. I was aware, of course, that they did a lot more, but I just haven’t had the time to really look around and explore. Recently I was doing some investigation into "url to screenshot" services and discovered that Cloudflare had this, and not only that, it’s part of a suite of browser APIs that are really freaking awesome. Cloudflare’s Browser Rendering APIs do things like: Get the HTML of a page, but after JavaScript has executed, allowing it to get dynamic HTML Render a PDF to PDF Scrape HTML via selectors Parse out content via JSON schema (I’m absolutely... more →
Posted in: JavaScript

Build Your Own Localized Events Calendar using Diffbot’s Knowledge Graph

Finding out what’s going on in your city can be a bit of a chore. For me, I use a combination of Facebook, specifically accounts for local organizations and news channels, and our local Reddit forum. This is… haphazard at best. I’m sure local "city wide" calendars exist, but I’m not aware of any that is used by the majority of folks nor do I trust them to actually cover everything going on. Having played with Diffbot’s Knowledge Graph last month ("Automating and Responding to Sentiment Analysis with Diffbot’s Knowledge Graph"), I thought I’d do some digging to see what would be possible via their API. Here’s what I was able to... more →
Posted in: JavaScript

Using AI in the Browser for Typo Rewriting

Last week I gave a presentation on Chrome’s new built-in AI support (I’ll link the video at the end) and it’s gotten me inspired to consider new and different ways these APIs can be used to enhance the user experience. These APIs still aren’t quite ready for production use, and it’s absolutely possible we may never see these in Safari or Firefox, but the possibility of using them to enhance an application where available is exciting. For today, I want to share an interesting use case that occurred to me a few weeks ago. One of the APIs being built is a translation API (along with a language detection) API as well. In general the idea here is to go from one language... more →
Posted in: JavaScript

Using Java Libraries in BoxLang

One of the aspects that makes BoxLang compelling is that it runs on top of the Java Virtual Machine which means you get access to any Java library out there. This is something ColdFusion has as well and in the past, I’ve integrated Java libraries into my web apps to make use of open source from the Java community. Best of all, you don’t really need any Java knowledge to do this. Typically libraries will provide good docs and and examples and the mental model of translating a Java example to BoxLang’s language is fairly simple. A few days ago, I blogged an example of parallel processing in BoxLang and in one of the samples, I did a tiny bit of RSS feed processing. I mentioned... more →
Posted in: JavaScript

Using Parallel Looping in BoxLang

Last week I wrote about converting a Python file search script to BoxLang. In that post (and the original Python version) I mentioned how the utility wasn’t terribly efficient as it needed to recreate an index every time it ran. Despite this, the performance was pretty good, taking about two seconds or so to generate the file index from near seven thousand Markdown files. Right after I shared that post, Luis Majano shared an interesting performance tweak I had missed. In BoxLang (and to be fair, this is a feature both Lucee and ColdFusion have as well), when you loop over arrays, structures, and queries, you can enable parallel execution by simply adding an additional argument to the loop.... more →
Posted in: JavaScript

Using Intl.DurationFormat for Localized Durations

Last year I had the opportunity to give a talk on the web platform’s Intl specification. This made me incredibly happy because in preparing for the presentation, I discovered so many cool features and capabilities of the spec that I had no idea existed. Almost a year ago, I wrote up a blog post on Intl.RelativeTimeFormat, talking about how the API was easy to use, but perhaps a bit difficult when dealing when determining the best values to use when formatting dynamic dates. Today, I’m going to turn my attention to a related spec, Intl.DurationFormat The Basics The DurationFormat API works like so: Given a locale (defaulting to the browser’s locale) Given a set of values representing... more →
Posted in: JavaScript

Using Generative AI to Help in Customer Service

Ok, before I begin, let me be absolutely clear. I do not think AI can replace customer support. I do think it can supplement and help customer support however, and I’d like to share an example of what this could look like. Imagine your service has a customer service form or email address. Typically, you type in your question, send it off, and wait. But what if you could provide an AI generated answer immediately while the person waits? At worse it doesn’t help. At best, it could be exactly what they need and the request could be terminated saving everyone time. Let’s consider an example of this. Setting up the AI/RAG System Let’s start with the most complex part, the AI/RAG... more →
Posted in: JavaScript

Using Transformers.js for AI in the Browser

Two weeks ago I had the pleasure of attending, and speaking at, connect.tech. One of the cooler presentations I saw was from Danielle Maxwell where she discussed usingAI in the browser and introduced me to Transformers.js. I’d heard of this before, but wasn’t quite aware of how easy it was to use. While this isn’t necessarily going to replace a "real" GenAI server, it does feel compelling enough to something to consider. As my readers know, I’ve been playing with Chrome’s attempt to bake this in as well, and while that’s not quite ready for real use yet, Transformers.js feels like something you could play with right now. How to get started? Using... more →
Posted in: JavaScript
1 2 3 9