
If you're not a user of archiving services like archive.today to get past paywalls (or even if you are), you might have a lot of spam in your inbox. Eventually, you get fed up with it and book off an afternoon to get rid of all of it in an effort to get back to Inbox Zero.
What if you used a robot friend to get it done in an hour instead?
This article is aimed at non-technical audiences with enough technical seeds so developers new to using AI can also run with it to create their own projects. I was prompted to write this by a recent project for a client, a React/Web application that works with Gmail to do automatic categorization (sample code is coming soon!).
Note: AI-assist tools allowed me to complete this project in a weekend, just using their basic functionality of prompted code generation. Think of the process as having a very junior developer at your beck and call, telling them what to do and then reviewing logical units of work to make sure they're correct.
You can use a lot of different tools for this: Built in chat windows in Cursor and Windsurf, or completely separate command-line utilities like Claude Code . My preference is Claude Code, but I encourage you to experiment and see which one you like best!
We're going to skip the scaffolding of a basic React application and using OAuth to log in with Gmail and assume we have a working web app with 3 display areas: Our connected e-mail accounts, some categories we've defined, and the e-mails themselves.

For resiliency, we've designed our application with Anthropic as the primary API provider and OpenAI as the fallback: If we can't connect to Anthropic, we'll use OpenAI instead.
We let the user define their own categories, a logical object that has a friendly name we define and also a description of what kind of e-mails should go into it. When a new e-mail comes in, we ask our AI partner to read it and place it in the appropriate category, or the 'general' category if none match.
We also have AI give us quick summaries of each e-mail in our right-most pane: It reads the e-mail, and then generates a short summary for us. In the actual app if we click on the e-mail itself we get the original message text.
Now things get interesting: We want to make AI Agents that will process unsubscribe requests like a worker processing a job (you might be familiar with this through technologies like RabbitMQ, BullMQ or one of many other asynchronous worker systems).
These agents have to look through an email and find the unsubscribe link. If the site we're trying to unsubscribe from is really clever, they might only let us do this after ticking some boxes or doing some other complex UI interaction.
There's also a very specific wrinkle here: Our AI Agents have to 'look' at a web page to see all the controls we might have to interact with and/or success text that indicates we've unsubscribed. That means using a virtual web browser to view and take a screenshot of the unsubscribe page.
There are software packages that facilitate this like Playwright and Puppeteer, but they come with a catch: They don't work very well with serverless compute. It's highly recommended you look at a containerized backend like Railway instead so you don't run into any issues.
You can look at a hosted service like Browserless which lets you connect to a hosted web browser you can do things with, but it can be expensive if you want to connect to more than 1 virtual browser at a time.
How to create your job system will not be covered in this article, so we'll assume you have a working asynchronous task system that is ready to accept instructions.
Here's how our robot friend will specifically unsubscribe for us:

We'll have to generate a prompt here, or how we're going to specifically tell our robot friend to do this for us. I'm going to leave this as an exercise for you (if you want to skip this part, you can ask Claude or ChatGPT to help you with a pretty good starter prompt).
Optimizing prompts is a skill and this is a great project to develop that skill, watching what happens as you change and optimize the prompt to get our robot friend to do what you want.
For this project I ended up adding a bit of UI sugar in marking e-mail messages that launched a successful unsubscribe operation in green, ones in progress as yellow and failed ones in red. Feel free, though, to use whatever UI pattern you prefer!
I hope this article has been helpful for you, if only to learn about some things that our robot friends can do for us! Can you think of other ways they might be able to save us a lot of time?
<100 subscribers
1 comment
To the points, keep building ๐