Compare commits

..

2 Commits

Author SHA1 Message Date
blank X 1f62578794
Add two blogs to the blogroll 2022-06-12 21:16:57 +07:00
blank X 524c9e5148
Mark RSS Bridge feeds 2022-06-12 21:16:38 +07:00
2 changed files with 17 additions and 10 deletions

View File

@ -41,6 +41,7 @@ with open(sys.argv[1]) as file, open(sys.argv[2], 'w+') as out:
print(text) print(text)
out.write(text) out.write(text)
continue continue
rss_bridge = urlparse(feedurl).hostname.startswith('rss.')
try: try:
with urlopen(Request(feedurl, headers={'User-Agent': "stop being so fucking obsessed that i'm using urllib ffs"}), timeout=60) as resp: with urlopen(Request(feedurl, headers={'User-Agent': "stop being so fucking obsessed that i'm using urllib ffs"}), timeout=60) as resp:
if resp.status != 200: if resp.status != 200:
@ -68,22 +69,26 @@ with open(sys.argv[1]) as file, open(sys.argv[2], 'w+') as out:
url = input().strip() or url url = input().strip() or url
else: else:
url = url.text or url.attrib['href'] url = url.text or url.attrib['href']
text = f'<li><b><a href="{html.escape(urljoin(feedurl, url))}">{html.escape(find_ignore_ns(channel, "title").text)}</a> (<a href="{html.escape(feedurl)}">feed</a>)' text = f'<li><b><a href="{html.escape(urljoin(feedurl, url))}">{html.escape(find_ignore_ns(channel, "title").text)}</a> (<a href="{html.escape(feedurl)}">'
desc = find_ignore_ns(channel, 'description') if rss_bridge:
if desc is not None and desc.text: text += 'auto-generated '
if desc := desc.text.strip(): text += 'feed</a>)'
text += f':</b> {html.escape(desc)}' if not rss_bridge:
else: desc = find_ignore_ns(channel, 'description')
text += '</b>'
else:
desc = find_ignore_ns(channel, 'subtitle')
if desc is not None and desc.text: if desc is not None and desc.text:
if desc := desc.text.strip(): if desc := desc.text.strip():
text += f':</b> {html.escape(desc)}' text += f':</b> {html.escape(desc)}'
else: else:
text += '</b>' text += '</b>'
else: else:
text += '</b>' desc = find_ignore_ns(channel, 'subtitle')
if desc is not None and desc.text:
if desc := desc.text.strip():
text += f':</b> {html.escape(desc)}'
else:
text += '</b>'
else:
text += '</b>'
print(text, '</li>', sep='') print(text, '</li>', sep='')
out.write(text) out.write(text)
out.write('</li>\n') out.write('</li>\n')

View File

@ -21,6 +21,7 @@
<li><b><a href="https://80x24.net">80x24</a> (<a href="https://80x24.net/rss.xml">feed</a>):</b> Thoughts on the bits and bytes of life</li> <li><b><a href="https://80x24.net">80x24</a> (<a href="https://80x24.net/rss.xml">feed</a>):</b> Thoughts on the bits and bytes of life</li>
<li><b><a href="https://www.happyassassin.net/">AdamW on Linux and more</a> (<a href="https://www.happyassassin.net/feed.atom">feed</a>)</b></li> <li><b><a href="https://www.happyassassin.net/">AdamW on Linux and more</a> (<a href="https://www.happyassassin.net/feed.atom">feed</a>)</b></li>
<li><b><a href="http://feedpress.superfeedr.com/">Allen Pike</a> (<a href="https://feeds.allenpike.com/feed/">feed</a>)</b></li> <li><b><a href="http://feedpress.superfeedr.com/">Allen Pike</a> (<a href="https://feeds.allenpike.com/feed/">feed</a>)</b></li>
<li><b><a href="https://guzey.com/archive/">Archive - Alexey Guzey</a> (<a href="https://rss.zangetsu.kaizoku.cyou/?action=display&amp;bridge=XPath&amp;url=https%3A%2F%2Fguzey.com%2Farchive%2F&amp;item=%2F%2Ful%2Fli%5Bstrong%5D%5Ba%5D&amp;title=.%2Fa&amp;content=&amp;uri=.%2Fa%2F%40href&amp;author=&amp;timestamp=concat%28.%2Fpreceding%3A%3Ah2%5B1%5D%2C+%22-%22%2C+.%2Fstrong%29&amp;enclosures=&amp;categories=&amp;format=Mrss">auto-generated feed</a>)</li>
<li><b><a href="http://lucumr.pocoo.org/">Armin Ronacher&#x27;s Thoughts and Writings</a> (<a href="https://lucumr.pocoo.org/feed.atom">feed</a>):</b> Armin Ronacher&#x27;s personal blog about programming, games and random thoughts that come to his mind.</li> <li><b><a href="http://lucumr.pocoo.org/">Armin Ronacher&#x27;s Thoughts and Writings</a> (<a href="https://lucumr.pocoo.org/feed.atom">feed</a>):</b> Armin Ronacher&#x27;s personal blog about programming, games and random thoughts that come to his mind.</li>
<li><b><a href="https://axesslab.com">Axess Lab</a> (<a href="https://axesslab.com/feed/">feed</a>):</b> Digital accessibility consultants, reviews and development</li> <li><b><a href="https://axesslab.com">Axess Lab</a> (<a href="https://axesslab.com/feed/">feed</a>):</b> Digital accessibility consultants, reviews and development</li>
<li><b><a href="https://belaycpp.com">Belay the C++</a> (<a href="https://belaycpp.com/feed/">feed</a>):</b> A weekly blog talking about (usually bad) practices in C++</li> <li><b><a href="https://belaycpp.com">Belay the C++</a> (<a href="https://belaycpp.com/feed/">feed</a>):</b> A weekly blog talking about (usually bad) practices in C++</li>
@ -109,6 +110,7 @@
<li><b><a href="https://www.vidarholen.net/contents/blog">Vidar&#x27;s Blog</a> (<a href="https://www.vidarholen.net/contents/blog/?feed=rss2">feed</a>):</b> GNU, Linux and technology in general</li> <li><b><a href="https://www.vidarholen.net/contents/blog">Vidar&#x27;s Blog</a> (<a href="https://www.vidarholen.net/contents/blog/?feed=rss2">feed</a>):</b> GNU, Linux and technology in general</li>
<li><b><a href="https://www.whizzy.org/">whizzy.org</a> (<a href="https://www.whizzy.org/feed.xml">feed</a>):</b> whizzy.org RSS feed</li> <li><b><a href="https://www.whizzy.org/">whizzy.org</a> (<a href="https://www.whizzy.org/feed.xml">feed</a>):</b> whizzy.org RSS feed</li>
<li><b><a href="https://rachelbythebay.com/w/">Writing - rachelbythebay</a> (<a href="https://rachelbythebay.com/w/atom.xml">feed</a>)</b></li> <li><b><a href="https://rachelbythebay.com/w/">Writing - rachelbythebay</a> (<a href="https://rachelbythebay.com/w/atom.xml">feed</a>)</b></li>
<li><b><a href="https://milan.cvitkovic.net/writing/">Writings on Milan Cvitkovic</a> (<a href="https://milan.cvitkovic.net/writing/index.xml">feed</a>):</b> Recent content in Writings on Milan Cvitkovic</li>
<li><b><a href="https://xeiaso.net/blog">Xe&#x27;s Blog</a> (<a href="https://xeiaso.net/blog.rss">feed</a>):</b> Tech, philosophy and more</li> <li><b><a href="https://xeiaso.net/blog">Xe&#x27;s Blog</a> (<a href="https://xeiaso.net/blog.rss">feed</a>):</b> Tech, philosophy and more</li>
<li><b><a href="https://zmatt.net">zmatt.net</a> (<a href="https://zmatt.net/feed/">feed</a>)</b></li> <li><b><a href="https://zmatt.net">zmatt.net</a> (<a href="https://zmatt.net/feed/">feed</a>)</b></li>
<li><b><a href="https://eta.st/">η (eta)</a> (<a href="https://eta.st/feed.xml">feed</a>):</b> random mutterings of an insane nature</li> <li><b><a href="https://eta.st/">η (eta)</a> (<a href="https://eta.st/feed.xml">feed</a>):</b> random mutterings of an insane nature</li>