💾 Archived View for midnight.pub › posts › 1243 captured on 2024-05-12 at 15:52:14. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Midnight Pub

feed me content

~orchard

Hi ~bartender. Some chai please.

I don't want to attract the wrong kind of attention here, and don't mean to disrespect the pub at all.

BUT

I have created something. Well, it is the same feed for midnight pub, but it contains the content of posts as well, so I can read it easily from my feedreader. I have hosted it on my website. Here is the code for python if you want to use it too:

import xmltodict

a = requests.get("https://midnight.pub/feed.xml").text
xm = xmltodict.parse(a)
o = xm['feed']['entry']

for entry in o:
    htmltext = requests.get(entry['link']['@href'].replace("gemini","https")).text.split("<form")[0].split("<body >")[1]
    entry['content'] = {'#text': htmltext}
    entry['content']['@type'] = "html"

xm['feed']['entry'] = o
z = xmltodict.unparse(xm)

with open('feed.xml','w') as f:
    f.write(z)

Write a reply

Replies

~2pie wrote (thread):

Wow that would be great ! Do you have a link for the updated feed ?

~owleyarc wrote:

Nice! I've been meaning to try going back to feed readers.