From 8b66e17c20718ee96f76e813caa5f451736e5638 Mon Sep 17 00:00:00 2001 From: mez Date: Sat, 12 Jul 2025 19:22:32 +0100 Subject: [PATCH] Start redesign --- .gitignore | 3 +- archivesearch.py | 557 +++++++++++++++++++++++++++++++++++++++++++++++ new.py | 423 +++++++++++++++++++++++++++++++++++ 3 files changed, 982 insertions(+), 1 deletion(-) create mode 100644 archivesearch.py create mode 100644 new.py diff --git a/.gitignore b/.gitignore index 2c9bb2d..0ddbfc9 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ build/secret/*.gif build/secret/*.png build/emacs.jpg files/ -build/stats/*/index.html \ No newline at end of file +build/stats/*/index.html +index.html \ No newline at end of file diff --git a/archivesearch.py b/archivesearch.py new file mode 100644 index 0000000..7b6bfbb --- /dev/null +++ b/archivesearch.py @@ -0,0 +1,557 @@ +import datetime, os, re +from importlib import import_module + +starttime = datetime.datetime(1998,1,1) +endtime = datetime.datetime.today().date() + +choosetime = input("Select a date range? [y/N]\n") + +if choosetime == "y": + choosestart = input("Select a start date? [Y/n]\n") + if choosestart != "n": + starttimestring = input("Input start date (YYYYMMDD):\n") + starttime = datetime.datetime.strptime(starttimestring, "%Y%m%d") + chooseend = input("Select an end date? [Y/n]\n") + if chooseend != "n": + endtimestring = input("Input end date (YYYYMMDD):\n") + endtime = datetime.datetime.strptime(endtimestring, "%Y%m%d") + while endtime < starttime: + print("End date is before start date") + choosestart = input("Select a new start date? [Y/n]\n") + if choosestart != "n": + starttimestring = input("Input start date (YYYYMMDD):\n") + starttime = datetime.datetime.strptime(starttimestring, "%Y%m%d") + endtimestring = input("Input end date (YYYYMMDD):\n") + endtime = datetime.datetime.strptime(endtimestring, "%Y%m%d") + +if starttime == datetime.datetime(1998,1,1): + if endtime == datetime.datetime.today().date(): + print("Date range selected: all time") + else: + print("Date range selected: start to " + endtime.strftime("%Y-%m-%d")) +elif endtime == datetime.datetime.today().date(): + print("Date range selected: " + starttime.strftime("%Y-%m-%d") + " to now") +else: + print("Date range selected: " + starttime.strftime("%Y-%m-%d") + " to " + endtime.strftime("%Y-%m-%d")) + +if endtime == datetime.datetime.today().date(): + endtime = datetime.datetime.today() + +minwords = 0 +maxwords = 500000 + +choosewords = input("Select a word count range? [y/N]\n") + +if choosewords == "y": + chooseminwords = input("Select a minimum word count? [Y/n]\n") + if chooseminwords != "n": + minwords = int(input("Input minimum word count:\n")) + choosemaxwords = input("Select a maximum word count? [Y/n]\n") + if choosemaxwords != "n": + maxwords = int(input("Input maximum word count:\n")) + while maxwords < minwords: + print("Minimum word count exceeds maximum word count") + chooseminwords = input("Select a new minimum word count? [Y/n]\n") + if chooseminwords != "n": + minwords = int(input("Input minimum word count:\n")) + maxwords = int(input("Input maximum word count:\n")) + +if minwords == 0: + if maxwords == 500000: + print("Word count range selected: all") + else: + print("Word count range selected: up to " + str(maxwords)) +elif maxwords == 500000: + print("Word count range selected: at least " + str(minwords)) +else: + print("Word count range selected: " + str(minwords) + " to " + str(maxwords)) + +chooselang = input("Choose languages: English only [e], French only [f], or all [any key]\n") + +ficlist = [] + +ficcount = 500 +while ficcount > 0: + fileread = "" + ficcount -= 1 + if ficcount < 10: + ficcountstring = "00" + str(ficcount) + elif ficcount < 100: + ficcountstring = "0" + str(ficcount) + else: + ficcountstring = str(ficcount) + if os.path.exists("files/originalsmeta/" + ficcountstring + ".py"): + ficfile = "files.originalsmeta." + ficcountstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficcountstring + ".py"): + ficfile = "files.translationsmeta." + ficcountstring + fileread = import_module(ficfile) + if fileread: + if (fileread.datewords[0])["date"] >= starttime: + if (fileread.datewords[-1])["date"] <= endtime: + sumwords = 0 + for instalment in fileread.datewords: + sumwords = sumwords + instalment["words"] + if minwords <= sumwords <= maxwords: + if chooselang == "e": + if fileread.language == "en": + ficlist.append(ficcount) + elif chooselang == "f": + if fileread.language == "fr": + ficlist.append(ficcount) + else: + ficlist.append(ficcount) + +fandomslist = [] + +for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + try: + fandomslist.extend(fileread.fandom) + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + fandomslist.extend(origread.fandom) + except: + pass + +fandomlist = [] +for fandom in fandomslist: + if fandom not in fandomlist: + fandomlist.append(fandom) +fandomlist.sort() + +fandomnumbers = [] + +for fandom in fandomlist: + thenumber = 0 + for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + try: + if fandom in fileread.fandom: + thenumber += 1 + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + if fandom in origread.fandom: + thenumber += 1 + except: + pass + fandomnumbers.append({"fandom":fandom,"number":thenumber,"filtercheck":False}) + +fandomnumbers = sorted(fandomnumbers, key=lambda d: d["number"],reverse=True) + +print("Fandoms:") + +for fandom in fandomnumbers: + if fandom["number"] > 1: + print(fandom["fandom"] + ": " + str(fandom["number"]) + " fics") + else: + print(fandom["fandom"] + ": " + str(fandom["number"]) + " fic") + +fandomfilter = input("Filter by fandom? [y/N]\n") + +if fandomfilter == "y": + filteredfandoms = [] + fandommin = 0 + fandommax = 500 + choosemin = input("Choose only fandoms over a certain number of fics? [y/N]\n") + if choosemin == "y": + minstring = input("Minimum number of fics:\n") + fandommin = int(minstring) + choosemax = input("Choose only fandoms under a certain number of fics? [y/N]\n") + if choosemax == "y": + maxstring = input("Maximum number of fics:\n") + fandommax = int(maxstring) + refinefandoms = "y" + if choosemin == "y" or choosemax == "y": + refinefandoms = input("Refine fandoms further? [y/N]\n") + for fandom in fandomnumbers: + if fandommin <= fandom["number"] <= fandommax: + if refinefandoms == "y": + while fandom["filtercheck"] == False: + thefilter = input("Include " + fandom["fandom"] + " (" + str(fandom["number"]) + ")? [y/n]\n") + if thefilter == "y": + filteredfandoms.append(fandom) + fandom["filtercheck"] = True + elif thefilter == "n": + fandom["filtercheck"] = True + else: + print("Choose y or n") + continue + else: + filteredfandoms.append(fandom) + newficlist = [] + for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + for fandom in filteredfandoms: + try: + if fandom["fandom"] in fileread.fandom: + newficlist.append(fic) + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + if fandom["fandom"] in origread.fandom: + newficlist.append(fic) + except: + pass + ficlist = list(dict.fromkeys(newficlist)) + +shipslist = [] + +for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + try: + for ship in fileread.ship: + if ship != None: + shipslist.append(ship) + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + try: + for ship in origread.ship: + if ship != None: + shipslist.append(ship) + except: + shipslist.append("Gen") + except: + shipslist.append("Gen") + +shiplist = [] +for ship in shipslist: + if ship not in shiplist: + shiplist.append(ship) +shiplist.sort() + +genlist = {} + +for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + try: + if ship in fileread.ship: + pass + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + try: + if ship in origread.ship: + pass + except: + genlist[fic] = True + except: + genlist[fic] = True + +shipnumbers = [] + +for ship in shiplist: + if ship != "Gen": + thenumber = 0 + for fic in ficlist: + if fic not in genlist.keys(): + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + try: + if ship in fileread.ship: + thenumber += 1 + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + try: + if ship in origread.ship: + thenumber += 1 + except: + pass + except: + pass + if thenumber > 0: + shipnumbers.append({"ship":ship,"number":thenumber,"filtercheck":False}) + +shipnumbers.append({"ship":"Gen","number":len(genlist),"filtercheck":False}) + +shipnumbers = sorted(shipnumbers, key=lambda d: d["number"],reverse=True) + +# print(shipnumbers) + +print("Ships:") + +for ship in shipnumbers: + if ship["number"] > 1: + print(ship["ship"] + ": " + str(ship["number"]) + " fics") + else: + print(ship["ship"] + ": " + str(ship["number"]) + " fic") + +shipfilter = input("Filter by ship? [y/N]\n") + +if shipfilter == "y": + filteredships = [] + shipmin = 0 + shipmax = 500 + choosemin = input("Choose only ships over a certain number of fics? [y/N]\n") + if choosemin == "y": + minstring = input("Minimum number of fics:\n") + shipmin = int(minstring) + choosemax = input("Choose only ships under a certain number of fics? [y/N]\n") + if choosemax == "y": + maxstring = input("Maximum number of fics:\n") + shipmax = int(maxstring) + refineships = "y" + if choosemin == "y" or choosemax == "y": + refineships = input("Refine ships further? [y/N]\n") + for ship in shipnumbers: + if shipmin <= ship["number"] <= shipmax: + if refineships == "y": + while ship["filtercheck"] == False: + thefilter = input("Include " + ship["ship"] + " (" + str(ship["number"]) + ")? [y/n]\n") + if thefilter == "y": + filteredships.append(ship) + ship["filtercheck"] = True + elif thefilter == "n": + ship["filtercheck"] = True + else: + print("Choose y or n") + continue + else: + filteredships.append(ship) + newficlist = [] + for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + for ship in filteredships: + if ship["ship"] != "Gen": + try: + if ship["ship"] in fileread.ship: + newficlist.append(fic) + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + if ship["ship"] in origread.ship: + newficlist.append(fic) + except: + pass + else: + try: + if fileread.ship: + pass + except: + try: + origno = fileread.original + if origno < 10: + orignostring = "00" + str(origno) + elif origno < 100: + orignostring = "0" + str(origno) + else: + orignostring = str(origno) + if os.path.exists("files/originalsmeta/" + orignostring + ".py"): + orignofile = "files.originalsmeta." + orignostring + origread = import_module(orignofile) + try: + if fileread.ship: + pass + except: + newficlist.append(fic) + except: + newficlist.append(fic) + ficlist = list(dict.fromkeys(newficlist)) + +totalwords = 0 + +for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + for instalment in fileread.datewords: + totalwords = totalwords + instalment["words"] + +print("Total word count: " + str(totalwords) + "\n") + +print("Summaries of selected fics:\n") + +for fic in ficlist: + fileread = "" + if fic < 10: + ficstring = "00" + str(fic) + elif fic < 100: + ficstring = "0" + str(fic) + else: + ficstring = str(fic) + if os.path.exists("files/originalsmeta/" + ficstring + ".py"): + ficfile = "files.originalsmeta." + ficstring + fileread = import_module(ficfile) + elif os.path.exists("files/translationsmeta/" + ficstring + ".py"): + ficfile = "files.translationsmeta." + ficstring + fileread = import_module(ficfile) + if fileread: + print("Fic " + str(fic) + ", " + (fileread.datewords[-1])["date"].strftime("%-d %B %Y") + " • https://tre.praze.net/fic/single/" + ficstring) + try: + if fileread.showtitle: + print("\033[1m" + fileread.title + "\033[0m") + except: + pass + try: + print(re.sub("<[^<]+?>","",(re.sub(" "," ",fileread.summary)))) + except: + pass + print("\n") diff --git a/new.py b/new.py new file mode 100644 index 0000000..8ef301e --- /dev/null +++ b/new.py @@ -0,0 +1,423 @@ +import datetime, os +from importlib import import_module + +def classgen(string): + return string.replace(" ","").replace("#","").replace("-","").replace("ç","c").replace("’","").replace("é","e").replace("(","").replace(")","").replace(":","").lower() + +def stringno(theno): + if theno < 10: + return "00" + str(theno) + elif theno < 100: + return "0" + str(theno) + else: + return str(theno) + +ficcount = 999 +ficlist = [] +while ficcount > 0: + ficcount -= 1 + ficcountstring = stringno(ficcount) + if os.path.exists("files/originalsmeta/" + ficcountstring + ".py"): + ficfile = "files.originalsmeta." + ficcountstring + fileread = import_module(ficfile) + try: + if fileread.revealdate <= datetime.datetime.now(): + goahead = True + else: + goahead = False + except: + goahead = True + if goahead == True: + ficdict = {} + ficdict["id"] = ficcount + if fileread.showtitle: + ficdict["title"] = fileread.title + if fileread.language == "fr": + ficdict["french"] = "original" + else: + ficdict["french"] = False + sumwords = 0 + for instalment in fileread.datewords: + sumwords = sumwords + instalment["words"] + ficdict["totalwords"] = sumwords + ficdict["startdate"] = fileread.datewords[0]["date"] + ficdict["latestdate"] = fileread.datewords[-1]["date"] + try: + ficdict["approxdate"] = fileread.approxdate + except: + pass + if len(fileread.datewords) > 1: + ficdict["chaptered"] = True + else: + ficdict["chaptered"] = False + try: + ficdict["completion"] = fileread.status + except: + ficdict["completion"] = "complete" + ficdict["fandoms"] = [] + for fandom in fileread.fandom: + if fandom == "FF15": + ficdict["fandoms"].append("Final Fantasy XV") + elif fandom == "FF16": + ficdict["fandoms"].append("Final Fantasy XVI") + elif fandom == "FF4": + ficdict["fandoms"].append("Final Fantasy IV") + elif fandom == "FF6": + ficdict["fandoms"].append("Final Fantasy VI") + elif fandom == "FF7": + ficdict["fandoms"].append("Final Fantasy VII") + elif fandom == "FF8": + ficdict["fandoms"].append("Final Fantasy VIII") + elif fandom == "FF9": + ficdict["fandoms"].append("Final Fantasy IX") + elif fandom == "FFX": + ficdict["fandoms"].append("Final Fantasy X") + elif fandom == "LOTR": + ficdict["fandoms"].append("Lord Of The Rings") + else: + ficdict["fandoms"].append(fandom) + ficlist.append(ficdict) + ficdict["charmain"] = [] + try: + for character in fileread.charpov: + ficdict["charmain"].append(character) + except: + pass + try: + for character in fileread.charmain: + ficdict["charmain"].append(character) + except: + pass + ficdict["charsec"] = [] + try: + for character in fileread.charsecondary: + ficdict["charsec"].append(character) + except: + pass + try: + ficdict["ships"] = [] + for ship in fileread.ship: + if ship != None: + ficdict["ships"].append(ship.replace("/"," × ")) + except: + pass + if fileread.genre[0] == "slash" or fileread.genre[0] == "bl" or fileread.genre[0] == "yaoi": + ficdict["type"] = "BL" + elif fileread.genre[0] == "femslash" or fileread.genre[0] == "gl" or fileread.genre[0] == "yuri": + ficdict["type"] = "GL" + elif fileread.genre[0] == "het": + ficdict["type"] = "hetero" + else: + ficdict["type"] = "gen" + try: + if len(fileread.genre) > 1 and fileread.genre[1] != "slash": + ficdict["genre"] = fileread.genre[1] + else: + if fileread.time == "pre-canon" or fileread.time == "mid-canon" or fileread.time == "post-canon" or fileread.time == "AU": + ficdict["genre"] = fileread.time + except: + pass + try: + ficdict["summary"] = fileread.summary + except: + pass + try: + ficdict["event"] = fileread.eventname + ficdict["eventtype"] = fileread.event + except: + pass + try: + ficdict["prompt"] = fileread.prompt + except: + ficdict["prompt"] = False + if fileread.locked: + ficdict["locked"] = True + else: + ficdict["locked"] = False + if fileread.epub: + ficdict["epub"] = True + else: + ficdict["epub"] = False + if fileread.pdf: + ficdict["pdf"] = True + else: + ficdict["pdf"] = False + try: + transid = stringno(fileread.translation) + if os.path.exists("files/translationsmeta/" + transid + ".py"): + transfile = "files.translationsmeta." + transid + transread = import_module(transfile) + ficdict["transid"] = int(transid) + if transread.showtitle: + ficdict["transtitle"] = transread.title + if transread.language == "fr": + ficdict["french"] = "translation" + transwords = 0 + for instalment in transread.datewords: + transwords = transwords + instalment["words"] + ficdict["transwords"] = transwords + ficdict["transstartdate"] = transread.datewords[0]["date"] + ficdict["translatestdate"] = transread.datewords[-1]["date"] + ficdict["transsummary"] = transread.summary + except: + pass + +ficlist = sorted(ficlist,key=lambda d: d["latestdate"],reverse=True) + +fandoms = [] +challenges = [] +exchanges = [] +promptmemes = [] +for fic in ficlist: + for fandom in fic["fandoms"]: + fandoms.append(fandom) + try: + if fic["eventtype"] == "challenge": + challenges.append(fic["event"]) + elif fic["eventtype"] == "exchange" or fic["eventtype"] == "ao3exchange": + exchanges.append(fic["event"]) + elif fic["eventtype"] == "prompt": + promptmemes.append(fic["event"]) + except: + pass +fandoms = sorted(list(dict.fromkeys(fandoms))) +challenges = sorted(list(dict.fromkeys(challenges))) +exchanges = sorted(list(dict.fromkeys(exchanges))) +promptmemes = sorted(list(dict.fromkeys(promptmemes))) + +output = open("index.html", "w") + +output.write("\n\n \n \n \n praze • Fanfiction\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n

Fanfiction

\n

I’m partway through redesigning my fic archive and plan to gradually reinstate some of the features it used to have; for now, here’s a filterable masterlist. Warnings and ratings are not currently implemented, browse at your own risk. Some fics will have slight inaccuracies in metadata for the time being!

\n
\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n ") + +for fic in ficlist: + output.write("\n
1: + output.write(" fandom-crossover") + three = False + if fic["pdf"] == False: + output.write(" format-unusual") # ok for now … + elif fic["chaptered"]: + output.write(" format-chaptered") + else: + try: + if fic["event"] == "threesentenceficathon": + output.write(" format-three") + three = True + except: + pass + if three == False: + if fic["totalwords"] == 100: + output.write(" format-drabble") + elif fic["totalwords"] % 100 == 0: + output.write(" format-drabblefam") + else: + output.write(" format-oneshot") + try: + output.write(" event-" + classgen(fic["event"])) + except: + output.write(" unprompted") + if fic["locked"]: + output.write(" locked") + output.write("\">\n

no. " + stringno(fic["id"]) + "") + try: + output.write("/" + stringno(fic["transid"]) + "") + except: + pass + titles = 0 + try: + if fic["title"]: + titles += 1 + except: + pass + try: + if fic["transtitle"]: + titles += 1 + except: + pass + if titles > 0: + output.write(": ") + try: + output.write(fic["title"]) + except: + pass + if titles > 1: + output.write("/") + try: + output.write(fic["transtitle"]) + except: + pass + output.write("

\n
    \n
  • ") + try: + if fic["transid"]: + if fic["french"] == "original": + output.write("French: ") + elif fic["french"] == "translation": + output.write("English: ") + except: + pass + thewords = fic["totalwords"] + output.write(str(f"{thewords:,}" + " words, ")) + # output.write(str(fic["totalwords"]) + " words, ") + try: + output.write(fic["approxdate"]) + except: + output.write("" + datetime.datetime.strftime(fic["startdate"],"%Y-%m-%d") + "") + if fic["completion"] == "incomplete": + output.write("–present") + elif fic["latestdate"] != fic["startdate"]: + output.write("–" + datetime.datetime.strftime(fic["latestdate"],"%Y-%m-%d") + "") + if fic["completion"] == "abandoned": + output.write(" (abandoned)") + output.write("
  • ") + try: + if fic["transid"]: + output.write("\n
  • ") + if fic["french"] == "original": + output.write("English: ") + elif fic["french"] == "translation": + output.write("French: ") + output.write(str(fic["transwords"]) + " words, " + datetime.datetime.strftime(fic["transstartdate"],"%Y-%m-%d") + "") + if fic["translatestdate"] != fic["transstartdate"]: + output.write("–" + datetime.datetime.strftime(fic["translatestdate"],"%Y-%m-%d") + "") + output.write("
  • ") + except: + pass + output.write("\n
  • " + ", ".join(fic["fandoms"]) + "") + if len(fic["charmain"]) > 0: + output.write(", " + ", ".join(fic["charmain"])) + if len(fic["charsec"]) > 0: + output.write(", " + ", ".join(fic["charsec"]) + "") + output.write("
  • \n
  • " + fic["type"] + "") + try: + output.write(", " + fic["genre"]) + except: + pass + output.write("
  • ") + try: + output.write("\n
  • Written for " + fic["event"] + ".") + if fic["prompt"]: + output.write(" Prompt: " + fic["prompt"] + ".") + output.write("
  • ") + except: + pass + output.write("
  • ") + try: + if fic["transid"]: + if fic["french"] == "original": + output.write("French: ") + elif fic["french"] == "translation": + output.write("English: ") + except: + pass + output.write("HTML") + if fic["pdf"]: + output.write(" • PDF") + if fic["epub"]: + output.write(" • EPUB") + output.write("
  • ") + try: + if fic["transid"]: + output.write("
  • ") + if fic["french"] == "original": + output.write("English: ") + elif fic["french"] == "translation": + output.write("French: ") + output.write("HTML") + if fic["pdf"]: + output.write(" • PDF") + if fic["epub"]: + output.write(" • EPUB") + output.write("
  • ") + except: + pass + output.write("\n
") + thesummary = "" + try: + thesummary += fic["summary"] + except: + pass + try: + thesummary += " " + fic["transsummary"] + except: + pass + if len(thesummary) > 0: + output.write("\n
\n

" + thesummary + "

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