diff options
author | nathansmith117 <nathansmith@posteo.com> | 2025-03-17 12:54:50 -0600 |
---|---|---|
committer | nathansmith117 <nathansmith@posteo.com> | 2025-03-17 12:54:50 -0600 |
commit | 62d55d6f493945d414166fe6229b3433a2957a8d (patch) | |
tree | 29f8cfcf7afd00d729ef1846011a4694de86b39c | |
parent | 038ed7c5d3887919fcd8c528deee57ba159f52b4 (diff) |
I don't think they want me on their webring
-rwxr-xr-x | cgi-bin/webring_redirect.cgi | 68 | ||||
-rw-r--r-- | images/do_gay.png | bin | 2471 -> 0 bytes | |||
-rw-r--r-- | index.html | 13 |
3 files changed, 0 insertions, 81 deletions
diff --git a/cgi-bin/webring_redirect.cgi b/cgi-bin/webring_redirect.cgi deleted file mode 100755 index 299ed14..0000000 --- a/cgi-bin/webring_redirect.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#! /usr/bin/env python - -import cgi -import requests -import random -import json - -WEBSITE_URL = "http://nathansmith117.beevomit.org" - -def handle_be_crime_do_gay_webring(): - try: - # https://codeberg.org/artemislena/artemislena.eu#be-crime-do-gay-webring - req = requests.get("https://artemislena.eu/services/downloads/beCrimeDoGay.json", timeout=5) - req.raise_for_status - return req.json() - except requests.exceptions.Timeout: - return "Status: 503 Service Unavailable\n" - except Exception: - return "Status: 500 Internal Error\n" - -def handle_fields(): - form = cgi.FieldStorage() - - # Name of the webring name and direction. - name = form.getvalue("name") - direction = form.getvalue("direction") - - if name is None or direction is None: - return "Status: 400 Bad Request\n" - - # Callbacks to handle webrings. - webrings = { - "gay": handle_be_crime_do_gay_webring - } - - website_list = webrings[name]() - - if website_list == None or website_list == []: - return "Status: 500 Internal Error\n" - if type(website_list) is str: - return website_list - - # Find this website in webring. - position = 0 - - try: - position = website_list.index(WEBSITE_URL) - except ValueError: - return "Status: 400 Bad Request\n\nSite not added to webring yet" - - # Handle direction - redirect_website = "" - - if direction == "next": - redirect_website = website_list[(position + 1) % len(website_list)] - elif direction == "previous": - redirect_website = website_list[(position - 1) % len(website_list)] - elif direction == "random": - website_list.pop(position) - redirect_website = random.choice(website_list) - else: - return "Status: 400 Bad Request\n" - - return f"Status: 302 Found\nLocation: {redirect_website}\n" - -print("Content-Type: text/html") -print(handle_fields()) - diff --git a/images/do_gay.png b/images/do_gay.png Binary files differdeleted file mode 100644 index d0b4dd6..0000000 --- a/images/do_gay.png +++ /dev/null @@ -96,7 +96,6 @@ table { <img usemap="#w95widget" src="https://baccyflap.com/noai/w95widget.gif" alt="a gray Windows 95 style dialog box titled 'The No AI Webring' with a little icon showing a computer chip in a rubbish bin. beside it are three clickable buttons, labeled Previous, Random... and Next"> <br/><br/> - <!-- Music ring --> <div style="width:104px"> @@ -105,18 +104,6 @@ table { <a href="https://mr.jhorn.net/rand.php">rand</a> <a href="https://mr.jhorn.net/next.php?slug=nsw">next</a> </div> - - <br/><br/> - - <!-- Be crime do gay --> - <div style="width:104px"> - <a href="https://artemislena.eu/webring.html" target="_blank"> - <img src="images/do_gay.png" alt="pride flag"/> - </a> - <a href="cgi-bin/webring_redirect.cgi?name=gay&direction=previous">prev</a> - <a href="cgi-bin/webring_redirect.cgi?name=gay&direction=random">rand</a> - <a href="cgi-bin/webring_redirect.cgi?name=gay&direction=next">next</a> - </div> </td> <td> |