From 9cc9cedabbf7dc1b6fcdad0b6a6feb8763b5777a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 1 Dec 2022 22:29:27 +0000 Subject: tidying --- embed_old.cgi | 104 ---------------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100755 embed_old.cgi (limited to 'embed_old.cgi') diff --git a/embed_old.cgi b/embed_old.cgi deleted file mode 100755 index f574036..0000000 --- a/embed_old.cgi +++ /dev/null @@ -1,104 +0,0 @@ -#!/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