#!/usr/bin/env python3 from georgedata import george order = list(george.keys()) from os import getenv from urllib.parse import parse_qs qs = getenv("QUERY_STRING") query = parse_qs(qs) try: member = query["from"][0] dir = query["dir"][0] ind = order.index(member) offs = {"next":1,"prev":-1}[dir] except (ValueError,KeyError): print("Status: 400") print("Content-Type: text/html") print() print("