parent
d286b00da6
commit
3f1448f72d
@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = "Blogroll"
|
||||
+++
|
||||
|
||||
{{< blogroll >}}
|
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
if __name__ == "__main__":
|
||||
f = open("static/blogroll.opml", mode="rt")
|
||||
dest = open("layouts/shortcodes/blogroll.html", "w")
|
||||
out = ET.Element("div", attrib={"class": "blogroll"})
|
||||
|
||||
tree = ET.parse(f)
|
||||
root = tree.getroot()
|
||||
|
||||
p = ET.Element("p")
|
||||
p.text = "If the HTML URL is missing, the feed URL will be linked instead. You can also download my "
|
||||
aa = ET.Element("a")
|
||||
aa.attrib["href"] = "/blogroll.opml"
|
||||
aa.text = "OPML file here."
|
||||
p.append(aa)
|
||||
out.append(p)
|
||||
|
||||
for folder in root.findall("body")[0]:
|
||||
heading = ET.Element("h3")
|
||||
heading.text = folder.attrib["text"]
|
||||
out.append(heading)
|
||||
# print(folder.tag, folder.attrib)
|
||||
|
||||
ul = ET.Element("ul")
|
||||
for it in folder:
|
||||
# print(it.tag, it.attrib)
|
||||
li = ET.Element("li")
|
||||
a = ET.Element("a")
|
||||
|
||||
a.text = it.attrib["text"]
|
||||
|
||||
# use xmlUrl instead:
|
||||
if it.attrib["htmlUrl"] == "" or it.attrib["htmlUrl"] == "http:///":
|
||||
a.attrib["href"] = it.attrib["xmlUrl"]
|
||||
a.text += " (RSS)"
|
||||
else: # use htmlUrl
|
||||
a.attrib["href"] = it.attrib["htmlUrl"]
|
||||
|
||||
li.append(a)
|
||||
|
||||
ul.append(li)
|
||||
|
||||
out.append(ul)
|
||||
|
||||
# yeah, unicode to do str, not b'' (utf-8)
|
||||
# print(ET.tostring(out, encoding="unicode"))
|
||||
dest.write(ET.tostring(out, encoding="unicode"))
|
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- OPML generated by NetNewsWire -->
|
||||
<opml version="1.1">
|
||||
<head>
|
||||
<title>Subscriptions-iCloud.opml</title>
|
||||
</head>
|
||||
<body>
|
||||
<outline text="Blogs" title="Blogs">
|
||||
<outline text="'Nathan Burgoine" title="'Nathan Burgoine" description="" type="rss" version="RSS" htmlUrl="https://apostrophen.wordpress.com/" xmlUrl="https://apostrophen.wordpress.com/feed"/>
|
||||
<outline text="a rickety bridge of impossible crossing" title="a rickety bridge of impossible crossing" description="" type="rss" version="RSS" htmlUrl="https://bluelander.bearblog.dev/" xmlUrl="https://bluelander.bearblog.dev/feed/?type=rss"/>
|
||||
<outline text="Adventures in Linux and KDE" title="Adventures in Linux and KDE" description="" type="rss" version="RSS" htmlUrl="https://pointieststick.com/" xmlUrl="https://pointieststick.com/feed/"/>
|
||||
<outline text="Ariadne's Space" title="Ariadne's Space" description="" type="rss" version="RSS" htmlUrl="https://ariadne.space/" xmlUrl="https://ariadne.space/index.xml"/>
|
||||
<outline text="Chris Wiegman" title="Chris Wiegman" description="" type="rss" version="RSS" htmlUrl="https://chriswiegman.com/" xmlUrl="https://chriswiegman.com/feed"/>
|
||||
<outline text="Dhole Moments" title="Dhole Moments" description="" type="rss" version="RSS" htmlUrl="https://soatok.blog/" xmlUrl="https://soatok.blog/feed"/>
|
||||
<outline text="Drew DeVault's blog" title="Drew DeVault's blog" description="" type="rss" version="RSS" htmlUrl="https://drewdevault.com/" xmlUrl="https://drewdevault.com/blog/index.xml"/>
|
||||
<outline text="fasterthanli.me" title="fasterthanli.me" description="" type="rss" version="RSS" htmlUrl="" xmlUrl="https://fasterthanli.me/index.xml"/>
|
||||
<outline text="Icculus Microgrant news" title="Icculus Microgrant news" description="" type="rss" version="RSS" htmlUrl="https://icculus.org/microgrant/" xmlUrl="https://icculus.org/microgrant/news/icculus_microgrant.rss"/>
|
||||
<outline text="iliana.fyi" title="iliana.fyi" description="" type="rss" version="RSS" htmlUrl="" xmlUrl="https://iliana.fyi/atom.xml"/>
|
||||
<outline text="j3s.sh" title="j3s.sh" description="" type="rss" version="RSS" htmlUrl="" xmlUrl="https://j3s.sh/feed.atom"/>
|
||||
<outline text="mango.pdf.zone" title="mango.pdf.zone" description="" type="rss" version="RSS" htmlUrl="http:///" xmlUrl="https://mango.pdf.zone/feed.xml"/>
|
||||
<outline text="Nerd Teacher" title="Nerd Teacher" description="" type="rss" version="RSS" htmlUrl="https://nerdteacher.com/" xmlUrl="https://nerdteacher.com/feed/"/>
|
||||
<outline text="Posts on Honeypot.net" title="Posts on Honeypot.net" description="" type="rss" version="RSS" htmlUrl="https://honeypot.net/post/" xmlUrl="https://honeypot.net/post/index.xml"/>
|
||||
<outline text="Posts on Seirdy's Home" title="Posts on Seirdy's Home" description="" type="rss" version="RSS" htmlUrl="" xmlUrl="https://seirdy.one/posts/atom.xml"/>
|
||||
<outline text="Reads Rainbow" title="Reads Rainbow" description="" type="rss" version="RSS" htmlUrl="https://readsrainbow.com/" xmlUrl="https://readsrainbow.com/feed"/>
|
||||
<outline text="Sacha Chua" title="Sacha Chua" description="" type="rss" version="RSS" htmlUrl="https://sachachua.com/blog/feed/" xmlUrl="https://sachachua.com/blog/feed"/>
|
||||
<outline text="Steve Munro" title="Steve Munro" description="" type="rss" version="RSS" htmlUrl="https://stevemunro.ca/" xmlUrl="https://stevemunro.ca/feed"/>
|
||||
<outline text="Xe's Blog" title="Xe's Blog" description="" type="rss" version="RSS" htmlUrl="https://xeiaso.net/blog" xmlUrl="https://xeiaso.net/blog.rss"/>
|
||||
</outline>
|
||||
<outline text="Food" title="Food">
|
||||
<outline text="Rainbow Plant Life" title="Rainbow Plant Life" description="" type="rss" version="RSS" htmlUrl="https://rainbowplantlife.com/" xmlUrl="https://rainbowplantlife.com/feed/"/>
|
||||
</outline>
|
||||
<outline text="Health" title="Health">
|
||||
<outline text="People's CDC" title="People's CDC" description="" type="rss" version="RSS" htmlUrl="https://peoplescdc.substack.com/" xmlUrl="https://peoplescdc.substack.com/feed"/>
|
||||
<outline text="Stories by Joey Fox on Medium" title="Stories by Joey Fox on Medium" description="" type="rss" version="RSS" htmlUrl="https://medium.com/@joeyfox.85?source=rss-ec1dc6fc6757------2" xmlUrl="https://medium.com/feed/@joeyfox.85"/>
|
||||
<outline text="The Integral Guide to Well-Being" title="The Integral Guide to Well-Being" description="" type="rss" version="RSS" htmlUrl="https://integralguide.substack.com/" xmlUrl="https://integralguide.substack.com/feed"/>
|
||||
<outline text="Your Local Epidemiologist" title="Your Local Epidemiologist" description="" type="rss" version="RSS" htmlUrl="https://yourlocalepidemiologist.substack.com/" xmlUrl="https://yourlocalepidemiologist.substack.com/feed"/>
|
||||
</outline>
|
||||
<outline text="News" title="News">
|
||||
<outline text="CBC | Top Stories News" title="CBC | Top Stories News" description="" type="rss" version="RSS" htmlUrl="http://www.cbc.ca/news/?cmp=rss" xmlUrl="https://rss.cbc.ca/lineup/topstories.xml"/>
|
||||
<outline text="CBC | Toronto News" title="CBC | Toronto News" description="" type="rss" version="RSS" htmlUrl="http://www.cbc.ca/toronto/?cmp=rss" xmlUrl="https://rss.cbc.ca/lineup/canada-toronto.xml"/>
|
||||
<outline text="Daring Fireball" title="Daring Fireball" description="" type="rss" version="RSS" htmlUrl="https://daringfireball.net/" xmlUrl="https://daringfireball.net/feeds/json"/>
|
||||
<outline text="Xtra Magazine" title="Xtra Magazine" description="" type="rss" version="RSS" htmlUrl="https://xtramagazine.com/" xmlUrl="https://xtramagazine.com/feed"/>
|
||||
</outline>
|
||||
<outline text="Personal" title="Personal">
|
||||
<outline text="Blog on earnest ma" title="Blog on earnest ma" description="" type="rss" version="RSS" htmlUrl="https://earnestma.com/blog/" xmlUrl="https://earnestma.com/blog/index.xml"/>
|
||||
</outline>
|
||||
<outline text="Status" title="Status">
|
||||
<outline text="NetNewsWire" title="NetNewsWire" description="" type="rss" version="RSS" htmlUrl="https://nnw.ranchero.com/" xmlUrl="https://nnw.ranchero.com/feed.json"/>
|
||||
<outline text="Purelymail" title="Purelymail" description="" type="rss" version="RSS" htmlUrl="https://news.purelymail.com/" xmlUrl="https://news.purelymail.com/rss.xml"/>
|
||||
</outline>
|
||||
</body>
|
||||
</opml>
|
Loading…
Reference in new issue