Compare commits
10 commits
1eb36343e3
...
abdb1abdbc
Author | SHA1 | Date | |
---|---|---|---|
abdb1abdbc | |||
8ddca86ff0 | |||
1830a5f64d | |||
6502979225 | |||
e43cf71ba5 | |||
c075c2f0f7 | |||
2c2244e401 | |||
fafbbc80f5 | |||
6453435410 | |||
b1363a5be0 |
9 changed files with 75 additions and 60 deletions
|
@ -135,12 +135,19 @@ div.fic h1 span.ficnoprelim {
|
||||||
font-size: 0.6em;
|
font-size: 0.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.fic h1 span.abandoned {
|
div.fic h1 span.abandoned, div.fic h1 span.incomplete {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
background-color: #9c0000;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.fic h1 span.abandoned {
|
||||||
|
background-color: #9c0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.fic h1 span.incomplete {
|
||||||
|
background-color: #8ab60b;
|
||||||
|
}
|
||||||
|
|
||||||
div.fic ul.ficlinks li, div.fic ul.ficmeta li {
|
div.fic ul.ficlinks li, div.fic ul.ficmeta li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ def commentpage(ficno,directory,local=False):
|
||||||
headerfooter.headerwrite(commentspath + "/index.html","Comments for fic no. " + ficnostring,"Comments for fic no. <span id=\"ficno\">" + ficnostring + "</span>","",False,local)
|
headerfooter.headerwrite(commentspath + "/index.html","Comments for fic no. " + ficnostring,"Comments for fic no. <span id=\"ficno\">" + ficnostring + "</span>","",False,local)
|
||||||
filewrite = open(commentspath + "/index.html", "a")
|
filewrite = open(commentspath + "/index.html", "a")
|
||||||
if fffandom or timeelapsed.days < 730:
|
if fffandom or timeelapsed.days < 730:
|
||||||
filewrite.write("<h2>Leave a comment</h2>\n<noscript>\n<p><b>JavaScript is unavailable.</b> Please <a href=\"mailto:tre@praze.net\">email me</a> any comments.</p>\n</noscript>\n<p class=\"jsonly\">Comments will be posted manually; please expect a delay between submitting your comment and seeing it below!</p>\n<form id=\"theform\" onsubmit=\"sendContact(event)\" class=\"jsonly\">\n<input type=\"text\" id=\"nameInput\" required placeholder=\"Pseudonym (required)\">\n<input type=\"email\" id=\"emailInput\" placeholder=\"Email (if you want email notification of reply)\">\n<input type=\"text\" id=\"siteInput\" placeholder=\"Site (if you want a link back)\">\n<textarea id=\"messageInput\" rows=\"5\" required placeholder=\"Your comment (required, include whatever markup [or down] you like)\"></textarea>\n<button type=\"submit\">Submit</button>\n</form>\n")
|
filewrite.write("<h2>Leave a comment</h2>\n<noscript>\n<p><b>JavaScript is unavailable.</b> Please <a href=\"mailto:tre@praze.net\">email me</a> any comments.</p>\n</noscript>\n<p class=\"jsonly\">Comments will be posted manually; please expect a delay between submitting your comment and seeing it below!</p>\n<form id=\"theform\" onsubmit=\"sendContact(event)\" class=\"jsonly\">\n<input type=\"text\" id=\"nameInput\" required placeholder=\"Pseudonym (required)\">\n<input type=\"email\" id=\"emailInput\" placeholder=\"Email (if you want email notification of reply)\">\n<input type=\"text\" id=\"siteInput\" placeholder=\"Site (if you want a link back)\">\n<textarea id=\"messageInput\" rows=\"5\" maxlength=\"4800\" required placeholder=\"Your comment (required, include whatever markup [or down] you like)\"></textarea>\n<button type=\"submit\">Submit</button>\n</form>\n")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
if fileread.event == "ao3exchange" and (fileread.datewords[0])["date"].year > 2019:
|
if fileread.event == "ao3exchange" and (fileread.datewords[0])["date"].year > 2019:
|
||||||
|
@ -74,7 +74,7 @@ def commentpage(ficno,directory,local=False):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
if fileread.comments:
|
if fileread.comments:
|
||||||
filewrite.write("<h2>Archived comments</h2>\n<p>If you left one of these comments and would like it to be removed from the archive, please <a href=\"mailto:tre@praze.net\">email me</a>.</p>\n<p><small>My replies are included only if they were originally posted on this site.</small></p>\n")
|
filewrite.write("<h2>Archived comments</h2>\n<p>I often delete copies of my fics syndicated to other websites, so I archive comments here as a way of preserving them. If you left one of these comments and would like it to be removed from the archive, please <a href=\"mailto:tre@praze.net\">email me</a>.</p>\n<p><small>My replies are included only if they were originally posted on this site.</small></p>\n")
|
||||||
for comment in fileread.comments:
|
for comment in fileread.comments:
|
||||||
filewrite.write("<div class=\"comment\">\n<h1>")
|
filewrite.write("<div class=\"comment\">\n<h1>")
|
||||||
if comment["site"] == "dw":
|
if comment["site"] == "dw":
|
||||||
|
@ -119,7 +119,7 @@ def commentpage(ficno,directory,local=False):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if fffandom or timeelapsed.days < 730:
|
if fffandom or timeelapsed.days < 730:
|
||||||
filewrite.write("<script>\nasync function sendContact(ev) {\nev.preventDefault();\nconst theFic = document\n.getElementById('ficno').innerHTML;\nconst senderName = document\n.getElementById('nameInput').value;\nconst senderAddress = document\n.getElementById('emailInput').value;\nconst senderSite = document\n.getElementById('siteInput').value;\nconst senderMessage = document\n.getElementById('messageInput').value;\nconst webhookBody = {\nembeds: [{\ntitle: 'New comment received',\nfields: [\n{ name: 'Fic ID', value: theFic },\n{ name: 'Pseudonym', value: senderName },\n{ name: 'Email', value: senderAddress },\n{ name: 'Site', value: senderSite },\n{ name: 'Comment', value: senderMessage }\n]\n}],\n};\n\nconst webhookUrl = 'https://discord.com/api/webhooks/1110564759109120001/nJRKlR2vGf_kQNNniChju_kt5MA-Y6WC3c-3nTrDuwH8s3Pg4wUfgxwd1SI9ZHicXP0m';\n\nconst response = await fetch(webhookUrl, {\nmethod: 'POST',\nheaders: {\n'Content-Type': 'application/json',\n},\nbody: JSON.stringify(webhookBody),\n});\n\nif (response.ok) {\nalert('Comment submitted, thank you!');\n} else {\nalert('This is fucked, sorry.');\n}\n\ndocument.getElementById(\"theform\").reset();\n}\n</script>\n")
|
filewrite.write("<script>\nasync function sendContact(ev) {\nev.preventDefault();\nconst theFic = document\n.getElementById('ficno').innerHTML;\nconst senderName = document\n.getElementById('nameInput').value;\nconst senderAddress = document\n.getElementById('emailInput').value;\nconst senderSite = document\n.getElementById('siteInput').value;\nconst senderMessage = document\n.getElementById('messageInput').value;\nconst webhookUrl = 'https://kes.praze.net/api/v1/statuses';\nconst response = await fetch(webhookUrl, {\nmethod: 'POST',\nheaders: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer OTBKMDFMMJMTMZNKYY0ZMGQZLWJJMJUTYJE0MMY5ZJK3NJU4',\n },\n body: JSON.stringify({'status' : 'new comment on fic ' + theFic + ' from ' + senderName + ' (' + senderAddress + ', ' + senderSite + ')\\n\\n' + senderMessage}),\n});\n\nif (response.ok) {\nalert('Comment submitted, thank you!');\n} else {\nalert('This is fucked, sorry. Email me instead, whatever at praze dot net!');\n}\n\ndocument.getElementById(\"theform\").reset();\n}\n</script>\n")
|
||||||
filewrite.close()
|
filewrite.close()
|
||||||
headerfooter.footerwrite(commentspath + "/index.html",False,local)
|
headerfooter.footerwrite(commentspath + "/index.html",False,local)
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ def commentindex(local=False):
|
||||||
# write header
|
# write header
|
||||||
headerfooter.headerwrite("build/comments/index.html","Comments","Comments","",False,local)
|
headerfooter.headerwrite("build/comments/index.html","Comments","Comments","",False,local)
|
||||||
filewrite = open("build/comments/index.html", "a")
|
filewrite = open("build/comments/index.html", "a")
|
||||||
filewrite.write("<p>Comments I receive are archived on this site and linked back to the original. If you don’t want your comments from other sources archived here, or if you require any changes to the presentation of your comments, <a href=\"mailto:takedown@praze.net\">please email me</a>. Please note, however, that this website is not indexed by search engines and I don’t “advertise” it on mainstream social media.</p>\n<p>You can leave comments on the relevant comment pages for each fic (where this is enabled). If you’d like notification of any reply, please leave your email address. If you’d like a link from your pseudonym to a website, you can supply this as well. I’ll happily link to personal websites, Dreamwidth profiles, and (at least for now) AO3 profiles; I’m unlikely to include links to for-profit social media websites, Carrd, or Patreon.</p>\n<p>Comments are turned off on any fic over two years old unless it’s in a Final Fantasy fandom.</p>\n")
|
filewrite.write("<p>I tend to temporarily syndicate my fics to other websites and then delete them, so comments I receive are archived on this site and linked back to the original. If you don’t want your comments from other sources archived here, or if you require any changes to the presentation of your comments, <a href=\"mailto:takedown@praze.net\">please email me</a>. Please note, however, that this website is not indexed by search engines.</p>\n<p>If you haven’t switched off JavaScript, you can leave comments on the relevant comment pages for each fic (where this is enabled). Please leave your email address if you’d like notification of any reply. If you’d like a link from your pseudonym to a website, you can supply this as well, although I reserve the right not to link to certain advertising/tracker-heavy websites.</p>\n<p>Comments are turned off on some older fics.</p>\n")
|
||||||
filewrite.close()
|
filewrite.close()
|
||||||
headerfooter.footerwrite("build/comments/index.html",False,local)
|
headerfooter.footerwrite("build/comments/index.html",False,local)
|
||||||
|
|
||||||
|
|
|
@ -86,11 +86,11 @@ def eventlist(local=False):
|
||||||
position += 1
|
position += 1
|
||||||
eventlocation = (eventlist[position])["location"]
|
eventlocation = (eventlist[position])["location"]
|
||||||
if eventlocation == "dwjournal":
|
if eventlocation == "dwjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + theevent.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ theevent.replace("_","-") + ".dreamwidth.org/\"><b>" + theevent.replace("-","_")+ "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + theevent.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ theevent.replace("_","-") + ".dreamwidth.org/\"><b>" + theevent.replace("-","_")+ "</b></a></span>")
|
||||||
elif eventlocation == "dwcomm":
|
elif eventlocation == "dwcomm":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + theevent.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://" + theevent.replace("_","-") + ".dreamwidth.org/\"><b>" + theevent.replace("-","_") + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + theevent.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://" + theevent.replace("_","-") + ".dreamwidth.org/\"><b>" + theevent.replace("-","_") + "</b></a></span>")
|
||||||
elif eventlocation == "ljjournal":
|
elif eventlocation == "ljjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + theevent.replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ theevent.replace("_","-") + ".livejournal.com/\"><b>" + theevent.replace("-","_")+ "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + theevent.replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ theevent.replace("_","-") + ".livejournal.com/\"><b>" + theevent.replace("-","_")+ "</b></a></span>")
|
||||||
else:
|
else:
|
||||||
filewrite.write(theevent)
|
filewrite.write(theevent)
|
||||||
filewrite.write("</b> (" + str(len(evententries)) + ": " + ", ".join(eventfandoms) + ")</summary>\n")
|
filewrite.write("</b> (" + str(len(evententries)) + ": " + ", ".join(eventfandoms) + ")</summary>\n")
|
||||||
|
|
7
feed.py
7
feed.py
|
@ -11,7 +11,7 @@ def feedgen(local=False):
|
||||||
os.remove("build/feed.xml")
|
os.remove("build/feed.xml")
|
||||||
# write header
|
# write header
|
||||||
header = open("build/feed.xml", "a")
|
header = open("build/feed.xml", "a")
|
||||||
header.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n<channel>\n<atom:link href=\"https://tre.praze.net/fic/feed.xml\" rel=\"self\" type=\"application/rss+xml\" />\n<title>Tré’s fic archive</title>\n<link>https://tre.praze.net/fic</link>\n<description>All my fanfiction</description>\n<language>en-gb</language>\n")
|
header.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n<channel>\n<atom:link href=\"https://tre.praze.net/fic/feed.xml\" rel=\"self\" type=\"application/rss+xml\" />\n<title>Mez’s fic archive</title>\n<link>https://tre.praze.net/fic</link>\n<description>All my fanfiction</description>\n<language>en-gb</language>\n")
|
||||||
header.close()
|
header.close()
|
||||||
datelist = []
|
datelist = []
|
||||||
ficcount = 500
|
ficcount = 500
|
||||||
|
@ -160,8 +160,7 @@ def feedgen(local=False):
|
||||||
filewrite.write(", " + thegenre)
|
filewrite.write(", " + thegenre)
|
||||||
genred = True
|
genred = True
|
||||||
filewrite.write("</title>\n<pubDate>")
|
filewrite.write("</title>\n<pubDate>")
|
||||||
futuredate = date + datetime.timedelta(days=2)
|
filewrite.write(date.strftime("%a, %-d %b %Y"))
|
||||||
filewrite.write(futuredate.strftime("%a, %-d %b %Y"))
|
|
||||||
filewrite.write(" 00:00:00 GMT</pubDate>\n<link>")
|
filewrite.write(" 00:00:00 GMT</pubDate>\n<link>")
|
||||||
if local:
|
if local:
|
||||||
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/")
|
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/")
|
||||||
|
@ -185,7 +184,7 @@ def feedgen(local=False):
|
||||||
filewrite.write(" in this update")
|
filewrite.write(" in this update")
|
||||||
filewrite.write(".")
|
filewrite.write(".")
|
||||||
try:
|
try:
|
||||||
filewrite.write(" " + re.sub("<[^<]+?>","",re.sub("<span class=\"spoiler\">.*</span>","[spoiler]",thefile.summary)))
|
filewrite.write(" " + re.sub(" "," ",re.sub("<[^<]+?>","",re.sub("<span class=\"spoiler\">.*</span>","[spoiler]",thefile.summary))))
|
||||||
except:
|
except:
|
||||||
filewrite.write(" No summary provided.")
|
filewrite.write(" No summary provided.")
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -5,7 +5,7 @@ def headerwrite(output,title,headerone,desc,main=False,local=False,single=False,
|
||||||
header.write("/home/mdd/Documents/proj/fic-archive/build/")
|
header.write("/home/mdd/Documents/proj/fic-archive/build/")
|
||||||
else:
|
else:
|
||||||
header.write("/fic/")
|
header.write("/fic/")
|
||||||
header.write("archive.css\">\n<link rel=\"me\" href=\"https://kes.praze.net/@tre\">\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Tré's fic archive\" href=\"https://tre.praze.net/fic/feed.xml\">\n<meta name=\"theme-color\" content=\"#edc4c4\" />\n<title>" + title + "</title>\n<meta property=\"og:title\" content=\"Tré’s fanfiction\">\n<meta property=\"og:type\" content=\"website\">\n<meta property=\"og:image\" content=\"https://tre.praze.net/ab.png\">\n<meta name=\"description\" property=\"og:description\" content=\"Fanfiction on tre.praze.net\">\n<meta property=\"og:locale\" content=\"en_GB\">\n<meta property=\"og:site_name\" content=\"tre.praze.net\">\n<meta name=\"fediverse:creator\" content=\"@tre@praze.net\">\n")
|
header.write("archive.css\">\n<link rel=\"me\" href=\"https://kes.praze.net/@tre\">\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Mez's fic archive\" href=\"https://tre.praze.net/fic/feed.xml\">\n<meta name=\"theme-color\" content=\"#edc4c4\" />\n<title>" + title + "</title>\n<meta property=\"og:title\" content=\"Mez’s fanfiction\">\n<meta property=\"og:type\" content=\"website\">\n<meta property=\"og:image\" content=\"https://tre.praze.net/ab.png\">\n<meta name=\"description\" property=\"og:description\" content=\"Fanfiction on tre.praze.net\">\n<meta property=\"og:locale\" content=\"en_GB\">\n<meta property=\"og:site_name\" content=\"tre.praze.net\">\n<meta name=\"fediverse:creator\" content=\"@tre@praze.net\">\n")
|
||||||
if single:
|
if single:
|
||||||
header.write("<link rel=\"alternate\" type=\"application/activity+json\" href=\"https://fed.brid.gy/r/https://tre.praze.net/fic/single/" + ficnostring + "/\"")
|
header.write("<link rel=\"alternate\" type=\"application/activity+json\" href=\"https://fed.brid.gy/r/https://tre.praze.net/fic/single/" + ficnostring + "/\"")
|
||||||
header.write("<noscript>\n<style>.jsonly{display:none;}</style>\n</noscript>\n</head>\n<body>\n<div id=\"content\">\n<div id=\"inside\">\n<noscript>\n<div id=\"warning\">\n<p><b>Warning:</b> this part of my site is <b>18+</b>. Fics contain NSFW material and mature themes (death, suicide, mental illness, incest …). Browse at your own risk.</p>\n</div>\n</noscript>\n<h1>" + headerone + "</h1>\n" + desc + "\n")
|
header.write("<noscript>\n<style>.jsonly{display:none;}</style>\n</noscript>\n</head>\n<body>\n<div id=\"content\">\n<div id=\"inside\">\n<noscript>\n<div id=\"warning\">\n<p><b>Warning:</b> this part of my site is <b>18+</b>. Fics contain NSFW material and mature themes (death, suicide, mental illness, incest …). Browse at your own risk.</p>\n</div>\n</noscript>\n<h1>" + headerone + "</h1>\n" + desc + "\n")
|
||||||
|
@ -39,5 +39,5 @@ def footerwrite(output,main=False,local=False):
|
||||||
footer.write("/home/mdd/Documents/proj/fic-archive/build/")
|
footer.write("/home/mdd/Documents/proj/fic-archive/build/")
|
||||||
else:
|
else:
|
||||||
footer.write("/fic/")
|
footer.write("/fic/")
|
||||||
footer.write("verify/index.html?returnto=${window.location}`; }\n</script>\n</body>\n</html>")
|
footer.write("verify/index.html?returnto=${window.location}`; }\n</script>\n<a href=\"/\"><img src=\"/a.png\" style=\"position:fixed;bottom:2px;right:2px;\" title=\"home\"></a></body>\n</html>")
|
||||||
footer.close()
|
footer.close()
|
||||||
|
|
|
@ -56,9 +56,9 @@ def indexgen(local=False):
|
||||||
if os.path.exists("build/index.html"):
|
if os.path.exists("build/index.html"):
|
||||||
os.remove("build/index.html")
|
os.remove("build/index.html")
|
||||||
# write header
|
# write header
|
||||||
headerfooter.headerwrite("build/index.html","Tré’s fic archive","Tré’s fic archive","",True,local)
|
headerfooter.headerwrite("build/index.html","Mez’s fic archive","Mez’s fic archive","",True,local)
|
||||||
filewrite = open("build/index.html", "a")
|
filewrite = open("build/index.html", "a")
|
||||||
filewrite.write("<p>Here is all my fanfiction! Some of it is also syndicated elsewhere, but this site is the canonical location for everything I’ve written.</p>\n<p xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dct=\"http://purl.org/dc/terms/\"><strong>Transformative works policy:</strong> The contents of <a property=\"dct:title\" rel=\"cc:attributionURL\" href=\"https://tre.praze.net/fic\">these pages</a> are licensed under <a href=\"https://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\" rel=\"license\" style=\"display:inline-block;\">CC BY-NC 4.0. <img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1\" alt=\"\"><img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1\" alt=\"\"><img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1\" alt=\"\"></a> In other words, transformative works are permitted as long as there is a clearly visible hyperlink to the original and no financial transactions are involved.</p>\n<p>The code for this archive is available <a href=\"https://git.praze.net/tre/fic-archive\">here</a>. Commenting is switched on for most fics written at least semi-recently – read about that <a href=\"")
|
filewrite.write("<p>Here is all my fanfiction! Some of it is also syndicated elsewhere (often temporarily), but this site is the canonical location for everything I’ve written.</p>\n<p xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dct=\"http://purl.org/dc/terms/\"><strong>Transformative works policy:</strong> The contents of <a property=\"dct:title\" rel=\"cc:attributionURL\" href=\"https://tre.praze.net/fic\">these pages</a> are licensed under <a target=\"_blank\" href=\"https://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\" rel=\"license\" style=\"display:inline-block;\">CC BY-NC 4.0. <img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1\" alt=\"\"><img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1\" alt=\"\"><img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1\" alt=\"\"></a> In other words, transformative works are permitted as long as there is a clearly visible hyperlink to the original and no financial transactions are involved.</p>\n<p>The code for this archive is available <a target=\"_blank\" href=\"https://git.praze.net/tre/fic-archive\">here</a>. Commenting is switched on for most fics written at least semi-recently – read about that <a href=\"")
|
||||||
if local:
|
if local:
|
||||||
filewrite.write("comments/index.html")
|
filewrite.write("comments/index.html")
|
||||||
else:
|
else:
|
||||||
|
@ -96,7 +96,7 @@ def indexgen(local=False):
|
||||||
filewrite.write("events/index.html")
|
filewrite.write("events/index.html")
|
||||||
else:
|
else:
|
||||||
filewrite.write("/fic/events")
|
filewrite.write("/fic/events")
|
||||||
filewrite.write("\">Events</a></h2>\n<p>Since 2020 I’ve participated in some fandom exchanges and other events. Many of my more recent fics are in this category.</p>\n</div>\n<div class=\"fic\">\n<h2>Other</h2>\n<ul>\n<li>Stats by year: " + (str(statslist(local))) + "</li>\n</ul>\n</div>\n<div align=\"center\">\n<script>\ndocument.write('<script src=\"https://ficring.neocities.org/ring.js\"><\/script>');\n</script>\n</div>\n")
|
filewrite.write("\">Events</a></h2>\n<p>Since 2020 I’ve participated in some fandom exchanges and other events. Many of my more recent fics are in this category.</p>\n</div>\n<div class=\"fic\">\n<h2>Other</h2>\n<ul>\n<li>Stats by year: " + (str(statslist(local))) + "</li>\n</ul>\n</div>\n<div align=\"center\">\n<script src=\"https://ficring.neocities.org/ring.js\"></script>\n</div>\n")
|
||||||
filewrite.close()
|
filewrite.close()
|
||||||
headerfooter.footerwrite("build/index.html",True,local)
|
headerfooter.footerwrite("build/index.html",True,local)
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
filewrite.write("\">\n")
|
filewrite.write("\">\n")
|
||||||
# write html link if there is one
|
# write html link if there is one
|
||||||
if fileread.html:
|
if fileread.html:
|
||||||
filewrite.write("<li class=\"prazelink\"><a ")
|
filewrite.write("<li class=\"prazelink\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" href=\"")
|
filewrite.write("class=\"locked\" href=\"")
|
||||||
if local:
|
if local:
|
||||||
|
@ -61,7 +61,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
filewrite.write(ficnostring + ".html\">HTML</a></li>\n")
|
filewrite.write(ficnostring + ".html\">HTML</a></li>\n")
|
||||||
# write pdf link if there is one
|
# write pdf link if there is one
|
||||||
if fileread.pdf:
|
if fileread.pdf:
|
||||||
filewrite.write("<li class=\"prazelink\"><a ")
|
filewrite.write("<li class=\"prazelink\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" href=\"")
|
filewrite.write("class=\"locked\" href=\"")
|
||||||
if local:
|
if local:
|
||||||
|
@ -76,7 +76,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
filewrite.write(ficnostring + ".pdf\">PDF</a></li>\n")
|
filewrite.write(ficnostring + ".pdf\">PDF</a></li>\n")
|
||||||
# write epub link if there is one
|
# write epub link if there is one
|
||||||
if fileread.epub:
|
if fileread.epub:
|
||||||
filewrite.write("<li class=\"prazelink\"><a ")
|
filewrite.write("<li class=\"prazelink\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" href=\"")
|
filewrite.write("class=\"locked\" href=\"")
|
||||||
if local:
|
if local:
|
||||||
|
@ -92,7 +92,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
# write ao3 link if there is one
|
# write ao3 link if there is one
|
||||||
try:
|
try:
|
||||||
if fileread.ao3slug:
|
if fileread.ao3slug:
|
||||||
filewrite.write("<li class=\"ao3link\"><a class=\"u-syndication")
|
filewrite.write("<li class=\"ao3link\"><a target=\"_blank\" class=\"u-syndication")
|
||||||
try:
|
try:
|
||||||
if fileread.ao3locked:
|
if fileread.ao3locked:
|
||||||
filewrite.write(" locked")
|
filewrite.write(" locked")
|
||||||
|
@ -166,7 +166,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
filewrite.write("\">\n")
|
filewrite.write("\">\n")
|
||||||
# write html link if there is one
|
# write html link if there is one
|
||||||
if fileread.html:
|
if fileread.html:
|
||||||
filewrite.write("<li class=\"prazelink\"><a ")
|
filewrite.write("<li class=\"prazelink\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" href=\"")
|
filewrite.write("class=\"locked\" href=\"")
|
||||||
if local:
|
if local:
|
||||||
|
@ -181,7 +181,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
filewrite.write(translationstring + ".html\">HTML</a></li>\n")
|
filewrite.write(translationstring + ".html\">HTML</a></li>\n")
|
||||||
# write pdf link if there is one
|
# write pdf link if there is one
|
||||||
if fileread.pdf:
|
if fileread.pdf:
|
||||||
filewrite.write("<li class=\"prazelink\"><a ")
|
filewrite.write("<li class=\"prazelink\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" href=\"")
|
filewrite.write("class=\"locked\" href=\"")
|
||||||
if local:
|
if local:
|
||||||
|
@ -196,7 +196,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
filewrite.write(translationstring + ".pdf\">PDF</a></li>\n")
|
filewrite.write(translationstring + ".pdf\">PDF</a></li>\n")
|
||||||
# write epub link if there is one
|
# write epub link if there is one
|
||||||
if fileread.epub:
|
if fileread.epub:
|
||||||
filewrite.write("<li class=\"prazelink\"><a ")
|
filewrite.write("<li class=\"prazelink\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" href=\"")
|
filewrite.write("class=\"locked\" href=\"")
|
||||||
if local:
|
if local:
|
||||||
|
@ -212,7 +212,7 @@ def linkgen(ficno,output="output.html",local=False):
|
||||||
# write ao3 link if there is one
|
# write ao3 link if there is one
|
||||||
try:
|
try:
|
||||||
if fileread.ao3slug:
|
if fileread.ao3slug:
|
||||||
filewrite.write("<li class=\"ao3link\"><a ")
|
filewrite.write("<li class=\"ao3link\"><a target=\"_blank\" ")
|
||||||
if fileread.locked:
|
if fileread.locked:
|
||||||
filewrite.write("class=\"locked\" ")
|
filewrite.write("class=\"locked\" ")
|
||||||
filewrite.write("href=\"https://archiveofourown.org/works/" + str(transread.ao3slug) + "\">AO3</a></li>\n")
|
filewrite.write("href=\"https://archiveofourown.org/works/" + str(transread.ao3slug) + "\">AO3</a></li>\n")
|
||||||
|
@ -325,6 +325,8 @@ def ficgen(ficno,unique=False,output="output.html",local=False,single=False):
|
||||||
pass
|
pass
|
||||||
if fileread.status == "abandoned":
|
if fileread.status == "abandoned":
|
||||||
filewrite.write(" <span class=\"abandoned\"> (abandoned)</span>")
|
filewrite.write(" <span class=\"abandoned\"> (abandoned)</span>")
|
||||||
|
elif fileread.status == "incomplete":
|
||||||
|
filewrite.write(" <span class=\"incomplete\"> (in progress)</span>")
|
||||||
filewrite.write("</h1>\n<div class=\"e-content\">\n<ul class=\"ficmeta\">\n<li class=\"ficdate\"><i>Date:</i> ")
|
filewrite.write("</h1>\n<div class=\"e-content\">\n<ul class=\"ficmeta\">\n<li class=\"ficdate\"><i>Date:</i> ")
|
||||||
# write date, date range if ranged or translation
|
# write date, date range if ranged or translation
|
||||||
if fileread.status == "incomplete":
|
if fileread.status == "incomplete":
|
||||||
|
@ -501,14 +503,19 @@ def ficgen(ficno,unique=False,output="output.html",local=False,single=False):
|
||||||
# write event details if there are any
|
# write event details if there are any
|
||||||
try:
|
try:
|
||||||
if fileread.eventname == "fail-fandomanon":
|
if fileread.eventname == "fail-fandomanon":
|
||||||
filewrite.write("In response to prompt at <span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://fail-fandomanon.dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://fail-fandomanon.dreamwidth.org/\"><b>fail_fandomanon</b></a></span>: <i>" + fileread.prompt + "</i>.")
|
filewrite.write("In response to prompt at <span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://fail-fandomanon.dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://fail-fandomanon.dreamwidth.org/\"><b>fail_fandomanon</b></a></span>: <i>" + fileread.prompt + "</i>.")
|
||||||
try:
|
try:
|
||||||
if fileread.notes:
|
if fileread.notes:
|
||||||
filewrite.write(" ")
|
filewrite.write(" ")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
elif fileread.eventname == "robotsoup":
|
elif fileread.eventname == "robotsoup":
|
||||||
filewrite.write("Written for <span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://kalloway.dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://kalloway.dreamwidth.org/\"><b>kalloway</b></a></span>’s " + fileread.eventdeets + " fest.")
|
filewrite.write("Written for <span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://kalloway.dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://kalloway.dreamwidth.org/\"><b>kalloway</b></a></span>’s " + fileread.eventdeets + " fest.")
|
||||||
|
elif fileread.eventname == "#ficwip":
|
||||||
|
filewrite.write("Written for the <a target=\"_blank\" href=\"https://ficwip.carrd.co\">#ficwip</a> event <i>" + fileread.eventdeets + "</i>")
|
||||||
|
if fileread.event == "prompt":
|
||||||
|
filewrite.write(", in response to prompt, <i>" + fileread.prompt + "</i>")
|
||||||
|
filewrite.write(".")
|
||||||
try:
|
try:
|
||||||
if fileread.notes:
|
if fileread.notes:
|
||||||
filewrite.write(" ")
|
filewrite.write(" ")
|
||||||
|
@ -518,11 +525,11 @@ def ficgen(ficno,unique=False,output="output.html",local=False,single=False):
|
||||||
filewrite.write("Written for ")
|
filewrite.write("Written for ")
|
||||||
try:
|
try:
|
||||||
if fileread.eventlocation == "dwcomm":
|
if fileread.eventlocation == "dwcomm":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + fileread.eventname.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://" + fileread.eventname.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.eventname.replace("-","_") + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + fileread.eventname.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://" + fileread.eventname.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.eventname.replace("-","_") + "</b></a></span>")
|
||||||
elif fileread.eventlocation == "dwjournal":
|
elif fileread.eventlocation == "dwjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + fileread.eventname.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ fileread.eventname.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.eventname.replace("-","_")+ "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + fileread.eventname.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ fileread.eventname.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.eventname.replace("-","_")+ "</b></a></span>")
|
||||||
elif fileread.eventlocation == "ljjournal":
|
elif fileread.eventlocation == "ljjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + fileread.eventname.replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ fileread.eventname.replace("_","-") + ".livejournal.com/\"><b>" + fileread.eventname.replace("-","_")+ "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + fileread.eventname.replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ fileread.eventname.replace("_","-") + ".livejournal.com/\"><b>" + fileread.eventname.replace("-","_")+ "</b></a></span>")
|
||||||
except:
|
except:
|
||||||
if fileread.eventname == "Semaine de la fic française":
|
if fileread.eventname == "Semaine de la fic française":
|
||||||
filewrite.write("<i>Semaine de la fic française</i>")
|
filewrite.write("<i>Semaine de la fic française</i>")
|
||||||
|
@ -541,15 +548,15 @@ def ficgen(ficno,unique=False,output="output.html",local=False,single=False):
|
||||||
if fileread.recip:
|
if fileread.recip:
|
||||||
try:
|
try:
|
||||||
if fileread.recipsite == "dw":
|
if fileread.recipsite == "dw":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + fileread.recip.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ fileread.recip.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.recip.replace("-","_") + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + fileread.recip.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ fileread.recip.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.recip.replace("-","_") + "</b></a></span>")
|
||||||
elif fileread.recipsite == "ao3":
|
elif fileread.recipsite == "ao3":
|
||||||
try:
|
try:
|
||||||
if fileread.recippseud:
|
if fileread.recippseud:
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://archiveofourown.org/users/"+ fileread.recip + "/pseuds/" + fileread.recippseud.replace(" ","%20") + "\"><b>" + fileread.recippseud + " (" + fileread.recip + ")</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://archiveofourown.org/users/"+ fileread.recip + "/pseuds/" + fileread.recippseud.replace(" ","%20") + "\"><b>" + fileread.recippseud + " (" + fileread.recip + ")</b></a></span>")
|
||||||
except:
|
except:
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://archiveofourown.org/users/"+ fileread.recip + "\"><b>" + fileread.recip + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://archiveofourown.org/users/"+ fileread.recip + "\"><b>" + fileread.recip + "</b></a></span>")
|
||||||
elif fileread.recipsite == "tumblr":
|
elif fileread.recipsite == "tumblr":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\"><a href=\"https://" + fileread.recip + ".tumblr.com\"><img src=\"https://www.tumblr.com/favicon.ico\" alt=\"[tumblr.com profile]\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\" width=\"16\" height=\"16\"></a><a href=\"https://" + fileread.recip + ".tumblr.com\"><b>" + fileread.recip + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\"><a target=\"_blank\" href=\"https://" + fileread.recip + ".tumblr.com\"><img src=\"https://www.tumblr.com/favicon.ico\" alt=\"[tumblr.com profile]\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\" width=\"16\" height=\"16\"></a><a target=\"_blank\" href=\"https://" + fileread.recip + ".tumblr.com\"><b>" + fileread.recip + "</b></a></span>")
|
||||||
except:
|
except:
|
||||||
filewrite.write(fileread.recip)
|
filewrite.write(fileread.recip)
|
||||||
filewrite.write("’s ")
|
filewrite.write("’s ")
|
||||||
|
@ -565,15 +572,15 @@ def ficgen(ficno,unique=False,output="output.html",local=False,single=False):
|
||||||
filewrite.write(", a gift for ")
|
filewrite.write(", a gift for ")
|
||||||
try:
|
try:
|
||||||
if fileread.recipsite == "dw":
|
if fileread.recipsite == "dw":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + fileread.recip.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ fileread.recip.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.recip.replace("-","_") + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + fileread.recip.replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ fileread.recip.replace("_","-") + ".dreamwidth.org/\"><b>" + fileread.recip.replace("-","_") + "</b></a></span>")
|
||||||
elif fileread.recipsite == "ao3":
|
elif fileread.recipsite == "ao3":
|
||||||
try:
|
try:
|
||||||
if fileread.recippseud:
|
if fileread.recippseud:
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://archiveofourown.org/users/"+ fileread.recip + "/pseuds/" + fileread.recippseud.replace(" ","%20") + "\"><b>" + fileread.recippseud + " (" + fileread.recip + ")</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://archiveofourown.org/users/"+ fileread.recip + "/pseuds/" + fileread.recippseud.replace(" ","%20") + "\"><b>" + fileread.recippseud + " (" + fileread.recip + ")</b></a></span>")
|
||||||
except:
|
except:
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a href=\"https://archiveofourown.org/users/" + fileread.recip + "\"><b>" + fileread.recip + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://archiveofourown.org/users/" + fileread.recip + "/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://archiveofourown.org/users/" + fileread.recip + "\"><b>" + fileread.recip + "</b></a></span>")
|
||||||
elif fileread.recipsite == "tumblr":
|
elif fileread.recipsite == "tumblr":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\"><a href=\"https://" + fileread.recip + ".tumblr.com\"><img src=\"https://www.tumblr.com/favicon.ico\" alt=\"[tumblr.com profile]\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\" width=\"16\" height=\"16\"></a><a href=\"https://" + fileread.recip + ".tumblr.com\"><b>" + fileread.recip + "</b></a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\"><a target=\"_blank\" href=\"https://" + fileread.recip + ".tumblr.com\"><img src=\"https://www.tumblr.com/favicon.ico\" alt=\"[tumblr.com profile]\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\" width=\"16\" height=\"16\"></a><a target=\"_blank\" href=\"https://" + fileread.recip + ".tumblr.com\"><b>" + fileread.recip + "</b></a></span>")
|
||||||
except:
|
except:
|
||||||
filewrite.write(fileread.recip)
|
filewrite.write(fileread.recip)
|
||||||
filewrite.write(".")
|
filewrite.write(".")
|
||||||
|
|
42
statsgen.py
42
statsgen.py
|
@ -185,31 +185,31 @@ def ficsum(ficcount,year,month=0,showfandom=True,local=False):
|
||||||
ficstring += ", "
|
ficstring += ", "
|
||||||
if language:
|
if language:
|
||||||
ficstring += language
|
ficstring += language
|
||||||
ficstring += "</a>"
|
ficstring += "</a> <span class=\"ficinfo\">"
|
||||||
if rating == "g":
|
if rating == "g":
|
||||||
ficstring += " <span style=\"background-color:#8ab60b;color:white; font-family:serif\"> U </span>"
|
ficstring += "<span title=\"universal\">🟢</span>"
|
||||||
elif rating == "t":
|
elif rating == "t":
|
||||||
ficstring += " <span style=\"background-color:#e8d405;color:white; font-family:serif\"> G </span>"
|
ficstring += "<span title=\"general\">🟡</span>"
|
||||||
elif rating == "m":
|
elif rating == "m":
|
||||||
ficstring += " <span style=\"background-color:#eb7d10;color:white; font-family:serif\"> M </span>"
|
ficstring += "<span title=\"mature\">🟠</span>"
|
||||||
elif rating == "e":
|
elif rating == "e":
|
||||||
ficstring += " <span style=\"background-color:#9c0000;color:white; font-family:serif\"> X </span>"
|
ficstring += "<span title=\"explicit\">🔴</span>"
|
||||||
for thegenre in genre:
|
for thegenre in genre:
|
||||||
if thegenre == "gen":
|
if thegenre == "gen":
|
||||||
ficstring += " <span style=\"background-color:#8ab60b;color:white; font-family:serif\"> ☉ </span>"
|
ficstring += "<span title=\"gen\">⭕</span>"
|
||||||
elif thegenre == "slash":
|
elif thegenre == "slash":
|
||||||
ficstring += " <span style=\"background-color:#1256b6;color:white; font-family:serif\"> ♂ </span>"
|
ficstring += "<span title=\"slash\">👨👨</span>"
|
||||||
elif thegenre == "het":
|
elif thegenre == "het":
|
||||||
ficstring += " <span style=\"background-color:#670840;color:white; font-family:serif\"> ⚤ </span>"
|
ficstring += "<span title=\"het\">👨👩</span>"
|
||||||
elif thegenre == "femslash":
|
elif thegenre == "femslash":
|
||||||
ficstring += " <span style=\"background-color:#d50636;color:white; font-family:serif\"> ♀ </span>"
|
ficstring += "<span title=\"femslash\">👩👩</span>"
|
||||||
elif thegenre == "poly":
|
elif thegenre == "poly":
|
||||||
ficstring += " <span><span style=\"background:linear-gradient(0deg, rgba(160,0,24,1) 0%, rgba(160,0,24,1) 49%, rgba(171,203,0,1) 50%, rgba(171,203,0,1) 100%);\"> </span><span style=\"background: linear-gradient(0deg, rgba(0,51,148,1) 0%, rgba(0,51,148,1) 49%, rgba(129,0,108,1) 50%, rgba(129,0,108,1) 100%);\"> </span></span>"
|
ficstring += "<span title=\"poly\">🧑➕</span>"
|
||||||
elif thegenre == "other":
|
elif thegenre == "other":
|
||||||
ficstring += " <span style=\"background-color:black;color:white; font-family:serif\"> ☿ </span>"
|
ficstring += "<span title=\"misc. romance/sex\">💖</span>"
|
||||||
if warnings:
|
if warnings:
|
||||||
ficstring += " <span style=\"background-color:#eb7d10;color:white; font-family:serif\"> !<small>?</small> </span>"
|
ficstring += "<span title=\"see notes for warnings\">❗</span>"
|
||||||
ficstring += " <code>" + str(words) + "</code>"
|
ficstring += "</span> <code>" + str(words) + "</code>"
|
||||||
return ficstring
|
return ficstring
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -476,11 +476,13 @@ def yeargen(local=False):
|
||||||
for event in neweventslist:
|
for event in neweventslist:
|
||||||
filewrite.write("<tr>\n<th>")
|
filewrite.write("<tr>\n<th>")
|
||||||
if event["eventlocation"] == "dwcomm":
|
if event["eventlocation"] == "dwcomm":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_") + "</a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_") + "</a></span>")
|
||||||
elif event["eventlocation"] == "dwjournal":
|
elif event["eventlocation"] == "dwjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
||||||
elif event["eventlocation"] == "ljjournal":
|
elif event["eventlocation"] == "ljjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + (event["eventname"]).replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ (event["eventname"]).replace("_","-") + ".livejournal.com/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ (event["eventname"]).replace("_","-") + ".livejournal.com/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
||||||
|
elif event["eventname"] == "#ficwip":
|
||||||
|
filewrite.write("<a target=\"_blank\" href=\"https://ficwip.carrd.co\">#ficwip</a>")
|
||||||
else:
|
else:
|
||||||
filewrite.write(event["eventname"])
|
filewrite.write(event["eventname"])
|
||||||
filewrite.write("</th>\n<td style=\"--size:calc(" + str(event["words"]) + " / " + str((neweventslist[0])["words"]) + ");\"><span class=\"data\">" + str(event["words"]) + "</span><span class=\"tooltip\">" + str(len(event["ficno"])) + " fic")
|
filewrite.write("</th>\n<td style=\"--size:calc(" + str(event["words"]) + " / " + str((neweventslist[0])["words"]) + ");\"><span class=\"data\">" + str(event["words"]) + "</span><span class=\"tooltip\">" + str(len(event["ficno"])) + " fic")
|
||||||
|
@ -491,11 +493,11 @@ def yeargen(local=False):
|
||||||
for event in neweventslist:
|
for event in neweventslist:
|
||||||
filewrite.write("<h3>")
|
filewrite.write("<h3>")
|
||||||
if event["eventlocation"] == "dwcomm":
|
if event["eventlocation"] == "dwcomm":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_") + "</a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/community.png\" alt=\"[community profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_") + "</a></span>")
|
||||||
elif event["eventlocation"] == "dwjournal":
|
elif event["eventlocation"] == "dwjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".dreamwidth.org/profile\"><img src=\"https://www.dreamwidth.org/img/silk/identity/user.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ (event["eventname"]).replace("_","-") + ".dreamwidth.org/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
||||||
elif event["eventlocation"] == "ljjournal":
|
elif event["eventlocation"] == "ljjournal":
|
||||||
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + (event["eventname"]).replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a href=\"https://"+ (event["eventname"]).replace("_","-") + ".livejournal.com/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a target=\"_blank\" href=\"https://" + (event["eventname"]).replace("_","-") + ".livejournal.com/profile\"><img src=\"https://www.dreamwidth.org/img/external/lj-userinfo.gif\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: baseline; border: 0; padding-right: 1px;\"></a><a target=\"_blank\" href=\"https://"+ (event["eventname"]).replace("_","-") + ".livejournal.com/\">" + (event["eventname"]).replace("-","_")+ "</a></span>")
|
||||||
else:
|
else:
|
||||||
filewrite.write(event["eventname"])
|
filewrite.write(event["eventname"])
|
||||||
filewrite.write("</h3>\n<ol>\n")
|
filewrite.write("</h3>\n<ol>\n")
|
||||||
|
@ -753,7 +755,7 @@ def yeargen(local=False):
|
||||||
filewrite.write("\">" + str(nextyear) + " »</a></span>")
|
filewrite.write("\">" + str(nextyear) + " »</a></span>")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
filewrite.write("</p>\n</div>\n</body>\n</html>")
|
filewrite.write("</p>\n</div>\n<a href=\"/\"><img src=\"/a.png\" style=\"position:fixed;bottom:2px;right:2px;\" title=\"home\"></a></body>\n</html>")
|
||||||
filewrite.close()
|
filewrite.close()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -9,7 +9,7 @@ def verifygen(local=False):
|
||||||
# write header
|
# write header
|
||||||
headerfooter.headerwrite("build/verify/index.html","Tré’s fic archive","Warning","",True,local)
|
headerfooter.headerwrite("build/verify/index.html","Tré’s fic archive","Warning","",True,local)
|
||||||
filewrite = open("build/verify/index.html", "a")
|
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>don’t like don’t 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 = \"")
|
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>don’t like don’t 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 src=\"https://ficring.neocities.org/ring.js\"></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:
|
if local:
|
||||||
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/index.html")
|
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/index.html")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue