#!/bin/python import os query = open("/env/QUERY_STRING", "r") q=query.read() if len(q) > 1: mancmd="man %s" % (q.strip().rstrip('\x00')) stream=os.popen(mancmd) output=stream.read() print "20 text/gemini\r\n" print output else: print "10 Lookup a man page\r\n" gemini://9til.de/cgi-bin/manpage

-- Leo's gemini proxy

-- Connecting to 9til.de:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/plain

-- Response ended

-- Page fetched on Sat May 18 18:59:53 2024