Blogroll



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 a machine-readable OPML if you that is your style.

Specialists

Pundits

make 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 likley import that OPML and subscribe you to all of these at once, if you want:

#! /usr/bin/env python3
"""
opml_to_blogroll.py

Parse OPML into markdown

opml_to_blogroll.py static/feeds.opml | xclip -selection clipboard
"""
import sys
import re
from xml.etree import ElementTree
from smartypants import smartypants, Attr

#https://pythonhosted.org/smartypants/reference.html#smartypants.smartypants
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')))
        for node in cat_node.findall('outline'):
            name = smartypants(node.attrib.get('text'), 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)
            print(line)


if __name__ == "__main__":
    main(*sys.argv[1:])

Warning! Experimental comments system! If is does not work for you, let me know via the contact form.

No comments yet!

GitHub-flavored Markdown & a sane subset of HTML is supported.