It's even worse than it appears..
Thursday May 12, 2022; 9:42 AM EDT
  • TL;DR -- there's a new expandIncludes function in the OPML package for JavaScript.#
  • As you know I'm working on a refresh of all the stuff I have related to RSS, and part of that is the use of OPML for subscription lists. #
  • A subscription list is an outline containing nodes of type rss that have an xmlUrl attribute that points to a feed. Even though the type is rss, it can be used to point to feeds in any format, including Atom and RDF. #
  • The lists can contain anything else you like, feeds, docs, and they can include other subscription lists. #
    • Example: You could maintain a list of people you follow and plug that into your reader's subscription list, and also offer it to friends, where they could include it in their list. And because you're using pointers, when your list updates, your friends are automatically updated. #
  • To include a list in another, just insert a node of type include, with a url attribute that points to another OPML file which should include nodes of type rss and possibly other include nodes. #
  • They work like includes in C, which is where the name came from. #
  • Anyway, the new thing is that the OPML package now has an expandIncludes function that can be given an outline, in a JavaScript object, and it returns an outline with all the include nodes expanded. #
  • I've had code that does this for decades in various environments. It's trivial in a language like C, Python, or Frontier -- any rational language that takes care of I/O under the hood, but it's a difficult problem in a language like JavaScript where you have to manage your own synchronization. This code first appeared in 2014 as part of PagePark, then moved to the daveopml package, and finally, today into the opml package. This is where it belongs, where everyone else can easily get to it. #
  • The new version, 0.4.24 is on GitHub and in NPM. There's a release note and example code with an OPML file that illustrates. #
  • If you have questions or comments post an issue in the repo.#
  • PS: This should also be useful in Tools For Thought projects.#

Last update: Thursday May 12, 2022; 1:02 PM EDT.

You know those obnoxious sites that pop up dialogs when they think you're about to leave, asking you to subscribe to their email newsletter? Well that won't do for Scripting News readers who are a discerning lot, very loyal, but that wouldn't last long if I did rude stuff like that. So here I am at the bottom of the page quietly encouraging you to sign up for the nightly email. It's got everything from the previous day on Scripting, plus the contents of the linkblog and who knows what else we'll get in there. People really love it. I wish I had done it sooner. And every email has an unsub link so if you want to get out, you can, easily -- no questions asked, and no follow-ups. Go ahead and do it, you won't be sorry! :-)