The internet of essays

Here is a blog roll of blogs/substacks/mediums etc that I subscribe to. For tips on how to use a blogroll, you might want to check feed readers. There is also a machine-readable OPML which you could import into your own feed reader, which would be much easier than clicking on hundreds of links, IMO, but you live your own life.



Dispatches from the internet trenches

Making things

Make your own automatic blogroll

This is the script I use to generate a blogroll from my OPML, a.k.a. my list of feed. PRO TIP: Your feed reader can likely import that OPML and subscribe you to all of these at once, if you want to swim in the same waters I do:

#! /usr/bin/env python3

Parse OPML into markdown static/feeds.opml | xclip -selection clipboard
import sys
import re
from xml.etree import ElementTree
from smartypants import smartypants, Attr

ATTRS = Attr.D | Attr.e | Attr.q | Attr.u

def main(fname):
    with open(fname, 'r', encoding='utf8') as fp:
        tree = ElementTree.parse(fp)
    for cat_node in tree.find('body').findall('outline'):
        print("\n## {}\n".format(cat_node.get('title', '').strip()))
        for node in cat_node.findall('outline'):
            name = smartypants(node.attrib.get('text', '').strip(), ATTRS)
            line = "* {}".format(name)
            url = node.attrib.get('htmlUrl', '')
            if len(url)>0:
                line = "* [{}]({})".format(name, url)
            feedurl = node.attrib.get('xmlUrl', None)
            line += " ([feed]({}))".format(feedurl)

if __name__ == "__main__":

No comments yet. Why not leave one?
