You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
2.0 KiB
Python

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import os
import headerfooter
def verifygen(local=False):
# delete existing file
if os.path.exists("build/verify/index.html"):
os.remove("build/verify/index.html")
# write header
headerfooter.headerwrite("build/verify/index.html","Trés fic archive","Warning","",True,local)
filewrite = open("build/verify/index.html", "a")
filewrite.write("<p><strong>Please note before proceeding:</strong></p>\n<p>Some of my fanfiction is NSFW (ranging from slightly obscene language to explicit sex scenes), some is RPF, and some of it contains mature or potentially objectionable themes (death, suicide, mental illness, incest …). Ratings and warnings are given accordingly, <strong>dont like dont read</strong>. If you consider yourself to be a minor, kindly gtfo and <em>read some real literature instead</em>. Honestly, it will be much more edifying.</p>\n<label for=\"verifyage-checkbox\">Please tick to confirm you have read this warning and are sufficiently mature to access this content:</label>\n<input type=\"checkbox\" id=\"verifyage-checkbox\">\n<button id=\"verifyage-button\">Let me in!</button>\n<div align=\"center\">\n<script>\ndocument.write('<script src=\"https://ficring.neocities.org/ring.js\"><\/script>');\n</script>\n</div>\n</div>\n</div>\n<script>\nvar verifyageButton = document.getElementById(\"verifyage-button\"); var verifyageCheckbox = document.getElementById(\"verifyage-checkbox\"); verifyageButton.addEventListener(\"click\", () => {if (verifyageCheckbox.checked) {localStorage.setItem(\"ageVerified\", \"\"); if (window.location = window.location.search.startsWith(\"?returnto=\")) {window.location = window.location.search.substring(\"?returnto=\".length);} else {window.location = \"")
if local:
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/index.html")
else:
filewrite.write("/fic")
filewrite.write("\";}} else {alert(\"You must agree before proceeding.\");}});\n</script>\n</body>\n</html>")
filewrite.close()
if __name__ == "__main__":
verifygen()