Let’s say I want to be an informed, engaged local citizen. Let’s say my town has a website set up where they post local updates and alerts that I might care about.
Specifically, let’s say there was a water main break a few days ago that led to everyone in the town being asked to boil water, and that I wanted to know when that boil advisory was over.
Sure, the information is right there on their website, so one option is to just reload the website all day and wait for an alert to pop up:
But what if my goal and wish is to have access to that information in a programmatic way? Such as, say, RSS, the technology that has long allowed websites to share information with each other in a format that other websites and software can read?
Once I have that, I could read the alert in a news reader, I could have it piped to a Slack or Discord channel, I could make a little notification appear on my computer desktop, make the lights flash using IFTTT or Zapier, or whatever was most useful to me. The steps would be:
- Get RSS feed link.
- Do whatever I want to with the information in the feed.
But this town does not offer an RSS feed on its website. Not for alerts, not for regular community news, nothing. (To make matters worse, it’s powered by web software that appears aimed at helping smaller towns and cities have a web presence, so we know this missing feature is now being repeated in communities across the world!)
What are my other options?
I could scrape the website’s source code and try to parse out the information I care about. This is a very viable option, but also tends to be somewhat fragile and messy.
The website source code can change structure, or the human entering the alert can decide to get fancy with some new HTML tags, or the web host can decide that your scraping bot is a nuisance and block it, and so on. You can end up spending hours and hours creating and maintaining such a tool.
So, any other options? Are there any other ways this website tool makes the alert information available?
Oh yes, email alerts.
This is better than nothing, as it allows an individual to (after identifying various boats and traffic lights) have the information come to them in at least some kind of usable format that doesn’t require refreshing the website all day.
But it still locks the information up inside my email inbox, and subjects it to the fragility of email delivery these days; will the town’s email servers be allowed to deliver the message? Will my email provider think it’s spam? Will I see the information in a timely manner?
So for fun, I wanted to see how many steps it would take to get the information contained in those alerts into a usable RSS feed.
Here they are:
- Create a dedicated email account that I’ll use for this experiment. Obtain its IMAP settings. Turn off spam filtering. (One time only.)
- Set up a WordPress website on a public facing web host. (One time only.)
- Set up and configure a WordPress plugin that retrieves email from an IMAP inbox and converts the contents to a WordPress post. (One time only.)
- Create a custom WordPress plugin that assigns the newly created posts to a specific Category based on the sender email address. (One time only.)
- Town sends out an alert by email.
- Email is received by dedicated email account.
- Email is retrieved by first WordPress plugin and converted into a post.
- Post is assigned to a category by second custom WordPress plugin.
- RSS feed for that WordPress category becomes available at
/category/feed/URI (because WordPress natively supports RSS feeds for posts, categories, tags, AHEM)
- My feed reading client retrieves that RSS feed once in a while to do something with it.
(If you’re curious about the specific technical details of this setup, I blogged about it separately.)
And it works! As seen in my Feedly account:
All those steps. Just to create the same functionality that the creators of the town’s website could have added in with what is now a trivial amount of effort given how mature the RSS standard is and how libraries and examples for implementing it are available many times over in every major programming language.
It’s ridiculous. And it shows how powerful RSS can be when site builders remember to include it. How much time it can save, and how many additional applications and integrations it can make possible.
So here I am, just a guy with a blog, begging you:
If you are a web developer, or if you are in any way responsible for putting information online in a way that is intended for others to consume,
make sure to include a simple RSS feed and a way for your users to discover it.
Your users will thank you. Other developers will thank you. The open web will thank you.