Extracting Data from Web Pages with AgentQL and BoxLang

I discovered AgentQL a few weeks ago and have been thinking about it quite a bit. In a nutshell, it lets you perform queries against a web page. They’ve got a simple query language that kinda reminds me of GraphQL, but simpler. So for example, consider the page you are on right now – if I wanted to get the tags, I could use this query: { tags[] } And it would return: { "tags": [ "#development", "#boxlang" ] } What if I wanted the links? I could change my query to express this: { tags[] { label url } } And then get: { "tags": [ { "label": "#development", "url":... more →
Posted in: JavaScript

Using GenAI to Create a SDK from Sample Code

I’ve been experimenting more and more with AI-assisted coding (not gonna call it vibe coding, even when I do), and the results have been incredibly interesting. Today, I decided to try something interesting – generating a SDK for an API. There are multiple tools out there that can convert an OpenAPI specification to an SDK (and those tools I’ve seen are pretty darn cool), but I wanted to attempt another route. Earlier this month I blogged about the new Foxit PDF APIs I’m working with. These APIs are all really simple, which is good of course, but when prepping for the release, I wanted to build code samples for every possible operation. I did so, and they’re up in... more →
Posted in: JavaScript

Results from My Vibe Coding Live Stream

Usually for my Code Break shows, I assume if folks miss it they’ll just check out the recordings, but while my earlier session is fresh in my mind, I thought I’d share a bit more about the session and a look at the code generated. It actually went a heck of a lot better than I anticipated to be honest, and was fun. To be clear, it wasn’t perfect, and I’ll touch a bit on what my tool of choice struggled with, but overall I’m really impressed with what I got built in an hour. What I Used and Why Constant readers here know I almost always use Google Gemini for anything AI related, but I’ve been trying to branch out a bit lately. Also, I found their Visual Studio... more →
Posted in: JavaScript

Creating a PDF Book from Markdown with BoxLang

Recently I’ve done some blog posts on BoxLang involving Markdown and PDFs, and I was curious if I could put together something that really demonstrated a complete tool of some sort. With that in mind, I built a "book" system where you can author pages in Markdown and use a BoxLang CLI script to generate a resulting PDF. It’s more a POC than a real app, but it was pretty fun to build. Here’s what I did. Functionality At a high level, the book is created from a source of Markdown files. Each Markdown file can use front matter (data on top) to define variables that are evaluated at the time the book is created. You can also use a "global" data file to define... more →
Posted in: JavaScript

How to Set Date Time from Mac Command Line

Working on a web extension that ships to an app store and isn’t immediately modifiable, like a website, can be difficult. Since you cannot immediately deploy updates, you sometimes need to bake in hardcoded date-based logic. Testing future dates can be difficult if you don’t know how to quickly change the date on your local machine. To change the current date on your Mac, execute the following from command line: # Date Format: MMDDYYYY sudo date -I 06142024 This command does not modify time, only the current date. Using the same command to reset to current date is easy as well! The post How to Set Date Time from Mac Command Line appeared first on David Walsh Blog. David Walsh... more →
Posted in: JavaScript

Live from the Sundhnúkur Eruption

The Reykjanes peninsula in Iceland has been experiencing a period of heightened volcanic activity since December 2023. This follows an increase in seismic activity that began in late 2019. The most recent eruption started on March 16th in Sundhnúkur near the town of Grindavík.You can view a live webcam of volcanic activity in Sundhnúkur on Live from Iceland.  This webcam shows a live Maps Mania… more →
Posted in: Interactive Maps

Extract a Number from a String with JavaScript

User input from HTML form fields is generally provided to JavaScript as a string. We’ve lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let’s rely on regular expressions to extract those numbers! To employ a regular expression to get a number within a string, we can use \d+: const string = "x12345david"; const [match] = string.match(/(\d+)/); match; // 12345 Regular expressions are capable of really powerful operations within JavaScript; this practice is one of the easier operations. Converting the number using a Number() wrapper will give you the number as a Number type. The... more →
Posted in: JavaScript

Coins Hoards from the Roman Empire

Ancient Rome had significant trade links with India, particularly during the Roman Empire under the rule of Augustus and onwards. The Silk Road and Indian Ocean trade routes facilitated the exchange of goods to Rome from India, including textiles, spices, gems, and other luxury items. You can find evidence of this trade between the Roman Empire and India on this interactive map of Maps Mania… more →
Posted in: Interactive Maps
1 2 3 7