commit 623d08c7805a4e0eee9d56db5eaed3204dfbc59d (patch)
Author: Alex Karle <email@example.com>
Date: Wed, 10 Feb 2021 00:20:57 -0500
use-feeds: Add new post on RSS/Atom feeds
Adding an Atom feed wasn't sufficient to curb my enthusiasm for this
piece of (old) tech, so I wrote a blog post advocating for it (and
detailing my adventures in implementing it, of course!) :)
|M||blog.7|| | ||3||+++|
|A||use-feeds.7|| | ||140||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
2 files changed, 143 insertions(+), 0 deletions(-)
diff --git a/blog.7 b/blog.7
@@ -14,6 +14,9 @@ feed (for use with your favorite RSS/Atom client).
From newest to oldest:
.Bl -bullet -compact
+.Xr use-feeds 7
+- RSS/Atom feeds; what, why, and how (02/09/2021)
.Xr my-old-man 7
- Adventures in using
.Xr mdoc 7
diff --git a/use-feeds.7 b/use-feeds.7
@@ -0,0 +1,140 @@
+.Dd February 9, 2021
+.Dt USE-FEEDS 7
+.Nd RSS/Atom feeds; what are they and why you should care
+.Bd -literal -offset indent
+Feed the birds
+Tuppence, a bag
+ ~ Mary Poppins
+I've always wanted this site to be an homage to tech that I
+enjoy using, and recently, that's included old-school RSS/Atom feeds.
+However, up until now, I had only been a feed consumer
+and had never produced my own.
+So, this past weekend I decided to hunker down and read enough
+of the spec to generate one for this site.
+But let's back up \(em what is a feed? Why should you care?
+A feed is simply a standardized listing of items a source
+(blog, vlog, newspaper, etc) has generated recently.
+Users then consume multiple feeds to get centralized notifications
+on new content.
+Think "following" on social media, but generalized for any content
+accessible on the web.
+The most important feature of a feed is that it has been standardized
+and is not controlled by any individual corporation.
+This ensures that users are not only free from vendor lock-in, but
+it also allows for an increasingly diverse set of clients and sources.
+For example, there are clients ranging from FOSS text only terminal
+.Lk https://newsboat.org newsboat(1)
+to commercial apps like
+.Lk https://feedly.com Feedly .
+And despite being drastically different UI's, their purpose is the same:
+allow you to subscribe to any number of feeds, and centralize your
+The idea is simple, but it's transformed the way I interact with the
+It saves me time in not browsing the infinite scroll that has
+become social media, and it allows me to stay up to date with smaller
+blogs that don't post frequently (cough, like yours truly, cough).
+Consider a new blog post on this site.
+Without a feed, you'd have to periodically check my
+.Xr blog 7
+or hear about it through some other link aggregation or social media
+site (Hackernews, Reddit, etc).
+Adding a feed allows those who want to follow to get notifications, without
+checking other locations or having to waste time checking back periodically.
+So if you haven't tried a feed reader ever, go find one that suits
+your fancy and give it a try!
+In an era where user upvoted content reigns king (Reddit, Facebook, etc),
+it's really empowering as a user to decide
+you see updates for and to be able to check them on your own time.
+And if you're a publisher of any content, consider creating a feed for
+others to follow.
+I'll certainly appreciate it!
+It's never too late to take control of your digital habits,
+and using a feed reader is a good place to start.
+If you read this far, I thought you might also be interested in hearing
+not only the what and the why but also the
+.Em how .
+Due to the recent migration to using
+.Xr mdoc 7
+as the markup for this site (detailed in
+.Xr my-old-man 7 ) ,
+I knew that finding an off-the-shelf feed generator would be unlikely.
+Plus, with my general desire to keep the site build-able by base OpenBSD,
+I figured it was as good an excuse as any to read the spec and generate
+I ended up choosing Atom over RSS mostly based on some online opinions
+that it is a stricter standard, but I can't say much to back that up.
+What I can say is that after the initial confusion of how to escape the
+embedded HTML in the XML feed, it was pretty smooth sailing.
+The full implementation is in
+.Lk https://alexkarle.com/git/alexkarle.com/file/genatom.sh.html genatom.sh
+and basically boils down to:
+.Bl -enum -compact
+.Xr grep 1
+call through the
+file to get a list of entries and their dates
+Print the header of the XML (with newest date from 1.)
+For each item in entries, add the XML entry along with the content
+as generated by
+.Xr mandoc 1
+.Fl O Ar fragment
+This ensures the "notification" has the full post \(em
+users never even need to visit the site!
+End by printing the footer of the XML
+And that's it!
+The only real trick was to use
+.Lk https://en.wikipedia.org/wiki/CDATA CDATA
+sections around the entry content in the XML to escape the HTML tags.
+And of course, like everything else in this blog, it rebuilds on git-push
+via a call to
+.Xr make 1 .
+.Lk https://alexkarle.com/git/alexkarle.com/file/Makefile.html Makefile
+for the recipe.
+.Sh SEE ALSO
+.Bl -bullet -compact
+.Xr blog 7
+My Atom feed:
+Wiki page on Atom: