Build an OPML file of new stuff in ohh.directory so you don't have to visit site-by-site in a browser

ยท 345 words ยท 2 minute read
Detail of a rusted bulldozer tread painted with chipped yellow paint.

I love that ooh.directory exists: It’s a clean, simple, helpful directory of blogs. The site publishes an RSS feed of all its latest additions, which is very helpful.

This automates the process of getting the feed from each blog into an OPML file you can import into your news reader:

https://paste.lol/mph/oohpml.rb

Starting from “what the hell do I even know about OPML?” and “what the hell do I even know about processing XML with Ruby?” over tea this morning, it is the bare minimum I could do to:

  • Consume the ooh.directory “Recently added blogs” feed.
  • Check each link in the feed for a feed. Since some CMSes make more than one, I make the very lazy assumption that the first one discovered is the right one. That might result in this thing pulling in comment feeds or something else.
  • Make sure the stuff coming from ooh.directory is contained to its own folder when I import the OPML feed. I was going to add categories, but the feed itself uses hard-coded HTML in a list. I guess I could have Nokogiri’d the first list from the bottom, but again … lazy.
  • Plop an OPML file out into the working directory, ready for import by most RSS readers.

How do you use it? ๐Ÿ”—

Save it to a file, run it with Ruby.

  • Open a terminal. cd to wherever you saved it.
  • Enter the command ruby oohpml.rb

It’ll drop an OPML file in the directory you ran it in. Most RSS readers seem to understand what to do with these things. It should put the new list of feeds in their own “ooh” directory. If you’re super worried, export your stuff to an OPML file before you import it.

What’s next? ๐Ÿ”—

Nothing. I pinged the owner of the site asking if he’d just implement OPML and he told me it’s coming as by-category OPML files at some point and this won’t be so useful.

So if it’s helpful, great. I felt a brief surge of delight knowing I wouldn’t have to go site-by-site to find feeds, subscribe, etc.