hn.py: handle post without URL
1 files changed, 3 insertions(+), 2 deletions(-) M hn.py
M hn.py => hn.py +3 -2
@@ 39,8 39,9 @@ if not path or path == "/": sys.stdout.write("20 text/gemini\r\n") print("# Hacker News\n") for post in posts: url = post['url'] print(f"=> web.sh?{quote(url)} {post['title']}") if 'url' in post: url = post['url'] print(f"=> web.sh?{quote(url)} {post['title']}") elif path == "/view": sys.stdout.write("20 text/gemini\r\n") sys.stdout.flush()