From 2b350a6e1e0413415860fa6786f6f443b9c23774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sat, 10 Jun 2023 09:47:13 +0100 Subject: [PATCH] Add age verification gate and some noscript fallbacks --- README.org | 8 ++++---- build/verify/.gitkeep | 0 commentpage.py | 2 +- generate.py | 3 +++ headerfooter.py | 9 +++++++-- indexgen.py | 2 +- verifygen.py | 21 +++++++++++++++++++++ 7 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 build/verify/.gitkeep create mode 100644 verifygen.py diff --git a/README.org b/README.org index b26fac6..5f9f196 100644 --- a/README.org +++ b/README.org @@ -20,8 +20,8 @@ Requisites: =rclone= (just for uploading files to the server), Python 3. - all my fics are (currently) on AO3, most have HTML versions, newer ones also have EPUB and PDF versions - I have weird rules about comments and sometimes turn them off after a certain period -** Future plans +** Future plans [1/3] -- redirect to a consent page using local storage -- pages for times and locations in FF fandoms -- possibly a page for non-FF fandoms (as if I even care about these lol) +- [X] redirect to a consent page using local storage (h/t [[https://www.fancoders.com/][Fandom Coders]]) +- [ ] pages for times and locations in FF fandoms +- [ ] possibly a page for non-FF fandoms (as if I even care about these lol) diff --git a/build/verify/.gitkeep b/build/verify/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/commentpage.py b/commentpage.py index 5b9a49c..ae42a43 100644 --- a/commentpage.py +++ b/commentpage.py @@ -65,7 +65,7 @@ def commentpage(ficno,directory,local=False): headerfooter.headerwrite(commentspath + "/index.html","Comments for fic no. " + ficnostring,"Comments for fic no. " + ficnostring + "","",False,local) filewrite = open(commentspath + "/index.html", "a") if fffandom or timeelapsed.days < 730: - filewrite.write("

Leave a comment

\n

Comments will be posted manually; please expect a delay between submitting your comment and seeing it below!

\n
\n\n\n\n\n\n
\n") + filewrite.write("

Leave a comment

\n\n

Comments will be posted manually; please expect a delay between submitting your comment and seeing it below!

\n
\n\n\n\n\n\n
\n") else: try: if fileread.event == "ao3exchange" and (fileread.datewords[0])["date"].year > 2019: diff --git a/generate.py b/generate.py index b92482b..672d644 100644 --- a/generate.py +++ b/generate.py @@ -7,6 +7,7 @@ import characters import ships import events import indexgen +import verifygen try: if sys.argv[1] == "local": @@ -26,6 +27,7 @@ if __name__ == "__main__": ships.shiplist(True) events.eventlist(True) indexgen.indexgen(True) + verifygen.verifygen(True) else: masterlist.listgen() commentpage.allcomments() @@ -34,3 +36,4 @@ if __name__ == "__main__": ships.shiplist() events.eventlist() indexgen.indexgen() + verifygen.verifygen() diff --git a/headerfooter.py b/headerfooter.py index a3c0b4b..5c3835b 100644 --- a/headerfooter.py +++ b/headerfooter.py @@ -5,7 +5,7 @@ def headerwrite(output,title,headerone,desc,main=False,local=False): header.write("/home/mdd/Documents/drive/proj/fic-archive/build/") else: header.write("/fic/") - header.write("archive.css\">\n\n\n\n" + title + "\n\n\n
\n
\n

" + headerone + "

\n" + desc + "\n") + header.write("archive.css\">\n\n\n\n" + title + "\n\n\n\n
\n
\n\n

" + headerone + "

\n" + desc + "\n") if not main: header.write("

\n\n\n

\n\n") + footer.write("\">\n\n
\n\n\n") footer.close() diff --git a/indexgen.py b/indexgen.py index bdffa8e..f9ed8a9 100644 --- a/indexgen.py +++ b/indexgen.py @@ -9,7 +9,7 @@ def indexgen(local=False): # write header headerfooter.headerwrite("build/index.html","Tré’s fic archive","Tré’s fic archive","",True,local) filewrite = open("build/index.html", "a") - filewrite.write("

Here is all my fanfiction! It’s also archived at AO3 under the name \"[archiveofourown.orgovely.

\n

Warning: 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, don’t like don’t read. If you happen to be under 18, kindly gtfo and read some real literature instead. Honestly, it will be much more edifying.

\n

I’ve recently implemented comments – read about that Here is all my fanfiction! It’s also archived at AO3 under the name \"[archiveofourown.orgovely.

\n

I’ve recently implemented comments – read about that Please note before proceeding:

\n

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, don’t like don’t read. If you happen to be under 18, kindly gtfo and read some real literature instead. Honestly, it will be much more edifying.

\n\n\n\n
\n
\n\n\n") + filewrite.close() + +if __name__ == "__main__": + verifygen()