commit aec721db2d528a3d0fa77439c55c9649bc151dc1 Author: askiiart Date: Wed Nov 8 22:59:30 2023 -0600 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..f86813d --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# askiiart/http-codes + +HTTP status codes for nginx, but better. + +## Original post + +Collection of [@yassie_j@0w0.is](https://0w0.is/yassie_j)'s HTTP response status codes: + +- 403 [You Shall Not Pass](https://0w0.is/notice/AZpeq9kdiVbKocpo0m) +- 301 [Your Princess in in Another Castle](https://0w0.is/notice/AZpfAtcGtx1gr4oHVg) +- 451 [Oi, You Got a Loicense For That Mate?](https://0w0.is/notice/AZpfQAPElAI5GszkAa) +- 204 [Head Empty No Thoughts](https://0w0.is/notice/AZpfdFJboofeGHbCUa) +- 402 [Come Back When You're a Little MMMMM Richer](https://0w0.is/notice/AZpfvcOck8SL3fhmwS) +- 413 [Me After A Night With Your Mother](https://0w0.is/notice/AZpgMXPNObkTPJtSKW) + - 417 me after 20-something years with my mother (from [Evvy](https://tech.lgbt/@pierogiburo/111076180358295709)) +- 502 [Forgive Me Father For My Gateway Has Sinned](https://0w0.is/notice/AZpgs0f6gIa775G4DQ) + - 504 Note: Gateway died on the way back to its home planet (from [spectrums i'm on: at least two](https://realworldsunny.name/notes/9k8j3jo5hf)) +- [508 508 508 508 508 508 508 508 508 508 508 508 508 508 508](https://0w0.is/notice/AZph3gHkGe5BOHtdJo) +- 418 [I'm A Teapot](https://0w0.is/notice/AZph69mBakLHR0JbVY) + (this is just the real one) +- 410 [Your Father](https://0w0.is/notice/AZphDH230s43xu7zxQ) +- 406 [I Can't Believe You've Done This](https://0w0.is/notice/AZphGgRsyF6Zf8q71c) +- 401 [This Is Against TOS You've Been + Reported](https://0w0.is/notice/AZphX4T5R1ksn5DPxA) +- 425 [Sorry This Never Happens With Other + Women](https://0w0.is/notice/AZphi280TWwAicaBVI) +- 202 [You In My Heart](https://0w0.is/notice/AZpiODVUYkViAigMfA) +- 300 [Poll](https://0w0.is/notice/AZpicIzowoUZFaaPdg) + - 57% Yes + - 43% No + - (300 Multiple Choices is the actual error code? Geddit?) +- 404 [You Made A Typo In The URL Didn't You](https://0w0.is/notice/AZpik5MrV9JpId4cTI) +- 423 [Fine Then Keep Your Secrets](https://0w0.is/notice/AZpj18ZUqKTa9u78Pg) + +## Additions + +- 409 [i'm scared stop asking me q.q](https://meow.woem.cat/notes/9lgiyx2aahggxb4d) + +## nginx rule + +```nginx +error_page 202 /error/202.html; +error_page 204 /error/204.html; +error_page 300 /error/300.html; +error_page 301 /error/301.html; +error_page 401 /error/401.html; +error_page 402 /error/402.html; +error_page 403 /error/403.html; +error_page 404 /error/404.html; +error_page 406 /error/406.html; +error_page 410 /error/410.html; +error_page 413 /error/413.html; +error_page 417 /error/417.html; +error_page 418 /error/418.html; +error_page 423 /error/423.html; +error_page 425 /error/425.html; +error_page 429 /error/429.html; +error_page 451 /error/451.html; +error_page 502 /error/502.html; +error_page 508 /error/508.html; +``` diff --git a/nginx-create-pages.py b/nginx-create-pages.py new file mode 100644 index 0000000..40a6182 --- /dev/null +++ b/nginx-create-pages.py @@ -0,0 +1,22 @@ +import requests +import os +import json + +url_404 = 'https://askiiart.net/sdlfjsadljfs' +html_404 = str(requests.get(url_404).text) + +try: + os.mkdir('pages') +except FileExistsError: + pass + +with open('status-codes.json', 'r') as codes_file: + codes_dict = json.load(codes_file) + +for code in codes_dict: + new_html = html_404.replace('404 Not Found', f'{code} {codes_dict[code]}') + with open(f'pages/{code}.html', 'w') as new_file: + new_file.write(new_html) + + +exit() \ No newline at end of file diff --git a/pages/202.html b/pages/202.html new file mode 100644 index 0000000..cde41d5 --- /dev/null +++ b/pages/202.html @@ -0,0 +1,7 @@ + +202 You In My Heart + +

202 You In My Heart

+
nginx/1.25.3
+ + diff --git a/pages/204.html b/pages/204.html new file mode 100644 index 0000000..122a766 --- /dev/null +++ b/pages/204.html @@ -0,0 +1,7 @@ + +204 Head Empty No Thoughts + +

204 Head Empty No Thoughts

+
nginx/1.25.3
+ + diff --git a/pages/300.html b/pages/300.html new file mode 100644 index 0000000..f49a947 --- /dev/null +++ b/pages/300.html @@ -0,0 +1,7 @@ + +300 Poll + +

300 Poll

+
nginx/1.25.3
+ + diff --git a/pages/301.html b/pages/301.html new file mode 100644 index 0000000..616fa20 --- /dev/null +++ b/pages/301.html @@ -0,0 +1,7 @@ + +301 Your Princess Is In Another Castle + +

301 Your Princess Is In Another Castle

+
nginx/1.25.3
+ + diff --git a/pages/401.html b/pages/401.html new file mode 100644 index 0000000..377d317 --- /dev/null +++ b/pages/401.html @@ -0,0 +1,7 @@ + +401 This Is Against TOS You've Been Reported + +

401 This Is Against TOS You've Been Reported

+
nginx/1.25.3
+ + diff --git a/pages/402.html b/pages/402.html new file mode 100644 index 0000000..eecfec8 --- /dev/null +++ b/pages/402.html @@ -0,0 +1,7 @@ + +402 Come Back When You're a Little MMMMMM Richer + +

402 Come Back When You're a Little MMMMMM Richer

+
nginx/1.25.3
+ + diff --git a/pages/403.html b/pages/403.html new file mode 100644 index 0000000..07408e8 --- /dev/null +++ b/pages/403.html @@ -0,0 +1,7 @@ + +403 You Shall Not Pass + +

403 You Shall Not Pass

+
nginx/1.25.3
+ + diff --git a/pages/404.html b/pages/404.html new file mode 100644 index 0000000..0b2d810 --- /dev/null +++ b/pages/404.html @@ -0,0 +1,7 @@ + +404 You Made A Typo In The URL, Didn't You? + +

404 You Made A Typo In The URL, Didn't You?

+
nginx/1.25.3
+ + diff --git a/pages/406.html b/pages/406.html new file mode 100644 index 0000000..1207448 --- /dev/null +++ b/pages/406.html @@ -0,0 +1,7 @@ + +406 I Can't Believe You've Done This + +

406 I Can't Believe You've Done This

+
nginx/1.25.3
+ + diff --git a/pages/410.html b/pages/410.html new file mode 100644 index 0000000..f7f4dd5 --- /dev/null +++ b/pages/410.html @@ -0,0 +1,7 @@ + +410 Your Father + +

410 Your Father

+
nginx/1.25.3
+ + diff --git a/pages/413.html b/pages/413.html new file mode 100644 index 0000000..101f556 --- /dev/null +++ b/pages/413.html @@ -0,0 +1,7 @@ + +413 Me After a Night With Your Mother + +

413 Me After a Night With Your Mother

+
nginx/1.25.3
+ + diff --git a/pages/417.html b/pages/417.html new file mode 100644 index 0000000..f2e35b4 --- /dev/null +++ b/pages/417.html @@ -0,0 +1,7 @@ + +417 Me After 20-something Years With My Mother + +

417 Me After 20-something Years With My Mother

+
nginx/1.25.3
+ + diff --git a/pages/418.html b/pages/418.html new file mode 100644 index 0000000..ad8743f --- /dev/null +++ b/pages/418.html @@ -0,0 +1,7 @@ + +418 I'm a Teapot + +

418 I'm a Teapot

+
nginx/1.25.3
+ + diff --git a/pages/423.html b/pages/423.html new file mode 100644 index 0000000..76e6893 --- /dev/null +++ b/pages/423.html @@ -0,0 +1,7 @@ + +423 Fine Then, Keep Your Secrets + +

423 Fine Then, Keep Your Secrets

+
nginx/1.25.3
+ + diff --git a/pages/425.html b/pages/425.html new file mode 100644 index 0000000..133d3fa --- /dev/null +++ b/pages/425.html @@ -0,0 +1,7 @@ + +425 Sorry This Never Happens With Other Women + +

425 Sorry This Never Happens With Other Women

+
nginx/1.25.3
+ + diff --git a/pages/429.html b/pages/429.html new file mode 100644 index 0000000..295b90e --- /dev/null +++ b/pages/429.html @@ -0,0 +1,7 @@ + +429 i'm scared stop asking me q.q + +

429 i'm scared stop asking me q.q

+
nginx/1.25.3
+ + diff --git a/pages/451.html b/pages/451.html new file mode 100644 index 0000000..7e8e962 --- /dev/null +++ b/pages/451.html @@ -0,0 +1,7 @@ + +451 Oi, You Got a Loicense For That Mate? + +

451 Oi, You Got a Loicense For That Mate?

+
nginx/1.25.3
+ + diff --git a/pages/502.html b/pages/502.html new file mode 100644 index 0000000..f8c0cdf --- /dev/null +++ b/pages/502.html @@ -0,0 +1,7 @@ + +502 Forgive Me Father For My Gateway Has Sinned + +

502 Forgive Me Father For My Gateway Has Sinned

+
nginx/1.25.3
+ + diff --git a/pages/508.html b/pages/508.html new file mode 100644 index 0000000..84e1780 --- /dev/null +++ b/pages/508.html @@ -0,0 +1,7 @@ + +508 508 508 508 508 508 508 508 508 508 508 508 508 508 508 + +

508 508 508 508 508 508 508 508 508 508 508 508 508 508 508

+
nginx/1.25.3
+ + diff --git a/status-codes.json b/status-codes.json new file mode 100644 index 0000000..5bb387e --- /dev/null +++ b/status-codes.json @@ -0,0 +1,21 @@ +{ + "403": "You Shall Not Pass", + "301": "Your Princess Is In Another Castle", + "451": "Oi, You Got a Loicense For That Mate?", + "204": "Head Empty No Thoughts", + "402": "Come Back When You're a Little MMMMMM Richer", + "413": "Me After a Night With Your Mother", + "417": "Me After 20-something Years With My Mother", + "502": "Forgive Me Father For My Gateway Has Sinned", + "508": "508 508 508 508 508 508 508 508 508 508 508 508 508 508", + "418": "I'm a Teapot", + "410": "Your Father", + "406": "I Can't Believe You've Done This", + "401": "This Is Against TOS You've Been Reported", + "425": "Sorry This Never Happens With Other Women", + "202": "You In My Heart", + "300": "Poll", + "404": "You Made A Typo In The URL, Didn't You?", + "423": "Fine Then, Keep Your Secrets", + "429": "i'm scared stop asking me q.q" +} \ No newline at end of file diff --git a/status-codes.tsv b/status-codes.tsv new file mode 100644 index 0000000..0d5c6e9 --- /dev/null +++ b/status-codes.tsv @@ -0,0 +1,19 @@ +403;You Shall Not Pass +301;Your Princess Is In Another Castle +451;Oi, You Got a Loicense For That Mate? +204;Head Empty No Thoughts +402;Come Back When You're a Little MMMMMM Richer +413;Me After a Night With Your Mother +417;Me After 20-something Years With My Mother +502;Forgive Me Father For My Gateway Has Sinned +508;508 508 508 508 508 508 508 508 508 508 508 508 508 508 +418;I'm a Teapot +410;Your Father +406;I Can't Believe You've Done This +401;This Is Against TOS You've Been Reported +425;Sorry This Never Happens With Other Women +202;You In My Heart +300;Poll +404;You Made A Typo In The URL, Didn't You? +423;Fine Then, Keep Your Secrets +429;i'm scared stop asking me q.q \ No newline at end of file diff --git a/tsv-to-json.py b/tsv-to-json.py new file mode 100644 index 0000000..b65a435 --- /dev/null +++ b/tsv-to-json.py @@ -0,0 +1,12 @@ +import csv +import json + +data = {} + +with open('status-codes.tsv', 'r') as tsvfile: + reader = csv.reader(tsvfile, delimiter=';') + for row in reader: + data[row[0]] = row[1] + +with open('status-codes.json', 'w') as jsonfile: + json.dump(data, jsonfile, indent=4) \ No newline at end of file