from lxml import etree
import urllib.request
URL = "https://finetuned.nl/freshrss/p/i/?a=rss&rid=610659e817a51&hours=168"
FILE = open("rss.html", "w")
print("", file=FILE)
print("
", file=FILE)
print("", file=FILE)
print("RSS Feed", file=FILE)
print("", file=FILE)
print("", file=FILE)
print("", file=FILE)
print("RSS Feed
", file=FILE)
print("", file=FILE)
feed = urllib.request.urlopen("https://finetuned.nl/freshrss/p/i/?a=rss&rid=610659e817a51&hours=168")
feed = etree.parse(feed)
feed = feed.getroot()
channel = feed.find("channel")
for item in channel.iterfind("item"):
title = item.find("title").text
guid = item.find("guid").text
contents = item.find("description").text
print(f"- {title}
", file=FILE)
with open(f"articles/{guid}.html", "w") as file:
print("", file=file)
print("", file=file)
print("", file=file)
print("RSS Feed", file=file)
print("", file=file)
print("", file=file)
print(contents, file=file)
print("", file=file)
print("", file=file)
print("
", file=FILE)
print("