Open external links in new tabs, set correct dates for RSS feed
This commit is contained in:
parent
6502979225
commit
1830a5f64d
7 changed files with 47 additions and 39 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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")
|
||||||
|
|
3
feed.py
3
feed.py
|
@ -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/")
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -58,7 +58,7 @@ def indexgen(local=False):
|
||||||
# write header
|
# write header
|
||||||
headerfooter.headerwrite("build/index.html","Tré’s fic archive","Tré’s fic archive","",True,local)
|
headerfooter.headerwrite("build/index.html","Tré’s fic archive","Tré’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, 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:
|
||||||
|
|
|
@ -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,16 +503,16 @@ 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":
|
elif fileread.eventname == "#ficwip":
|
||||||
filewrite.write("Written for the <a href=\"https://ficwip.carrd.co\">#ficwip</a> event <i>" + fileread.eventdeets + "</i>")
|
filewrite.write("Written for the <a target=\"_blank\" href=\"https://ficwip.carrd.co\">#ficwip</a> event <i>" + fileread.eventdeets + "</i>")
|
||||||
if fileread.event == "prompt":
|
if fileread.event == "prompt":
|
||||||
filewrite.write(", in response to prompt, <i>" + fileread.prompt + "</i>")
|
filewrite.write(", in response to prompt, <i>" + fileread.prompt + "</i>")
|
||||||
filewrite.write(".")
|
filewrite.write(".")
|
||||||
|
@ -523,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>")
|
||||||
|
@ -546,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 ")
|
||||||
|
@ -570,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(".")
|
||||||
|
|
16
statsgen.py
16
statsgen.py
|
@ -476,13 +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":
|
elif event["eventname"] == "#ficwip":
|
||||||
filewrite.write("<a href=\"https://ficwip.carrd.co\">#ficwip</a>")
|
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")
|
||||||
|
@ -493,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")
|
||||||
|
@ -755,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__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue