~sircmpwn/cgi-scripts

3f69081d388d0dc73f8ba7dd8ae4858ace150633 — Drew DeVault 4 years ago bd2ed88
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()