Some articles or comments I read and found interesting during this summer. Mostly from HN/lobste.rs, but I think there’s value in keeping track of what I read.
I kept track of these articles in a .md file, and extracted the articles using beautifulsoup. Is that overengineered ? Maybe. If I keep keeping track of those articles, storing them in a database as a cache + adding a search engine (postgres ? meilisearch ?) might be worth it.
import requests
from bs4 import BeautifulSoup
def load_urls(file="links.md"):
urls = []
with open(file) as f:
urls = list(map(lambda s:s.strip(), f.readlines()))
return urls
if __name__ == "__main__":
urls = load_urls()
for url in urls:
content = requests.get(url).content
soup = BeautifulSoup(content, "html.parser")
title = soup.find('title').string.strip()
print(f"[{title}]({url})")