From e79fe819f672d3454532181182732080e056592a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 11 Dec 2021 20:28:36 +0000 Subject: add existing content --- embed_old.cgi | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 embed_old.cgi (limited to 'embed_old.cgi') diff --git a/embed_old.cgi b/embed_old.cgi new file mode 100755 index 0000000..f574036 --- /dev/null +++ b/embed_old.cgi @@ -0,0 +1,104 @@ +#!/usr/bin/env python3 + +from georgedata import george +order = list(george.keys()) # dicts guarantee key order as of 3.7 + +from urllib.parse import urlparse +import sys + +from os import getenv +if __name__ == "__main__": + print("Content-Type: text/html") + qs = getenv("QUERY_STRING") + qs = qs.replace("%20"," ") + try: + ind = order.index(qs) + except ValueError: + print() + print('

no

') + else: + correct_hn = urlparse(george[qs]).hostname + + rf = getenv("HTTP_REFERER",None) + if rf is not None: + our_hn = urlparse(rf).hostname + if our_hn != correct_hn: + print() + print('

no

') + sys.exit(0) + + l = len(order) + ni = (ind + 1)%l + pi = (ind - 1)%l + n = george[order[ni]] + p = george[order[pi]] + ref = getenv("HTTP_REFERER","the") + + print(f"Content-Security-Policy: frame-ancestors {correct_hn} http://{correct_hn};") + print() + print( +f""" + + + + + + +
+

< PREV

+

+ The GEORGE is a noble animal. +

+

NEXT >

+
+ +""") + -- cgit v1.2.3