Add option for comments from discord

master
trémeur 1 year ago
parent 5bbece2ebe
commit 015f478ea7

@ -84,13 +84,15 @@ def commentpage(ficno,directory,local=False):
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><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;\" /><b>anonymous</b></a></span>")
elif comment["site"] == "lj":
if comment["registered"]:
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + comment["username"].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://"+ comment["username"].replace("_","-") + ".livejournal.com/\"><b>" + comment["username"].replace("-","_")+ "</b></a></span>")
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://" + comment["username"].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://" + comment["username"].replace("_","-") + ".livejournal.com/\"><b>" + comment["username"].replace("-","_")+ "</b></a></span>")
else:
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><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;\" /><b>anonymous</b></a></span>")
elif comment["site"] == "discord":
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><img src=\"https://www.dreamwidth.org/img/profile_icons/discord.png\" alt=\"[personal profile]\" width=\"17\" height=\"17\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px; background-color: white; border-radius: 10%;\" /><b>" + comment["username"] + "</b></span>")
elif comment["site"] == "ao3":
if comment["registered"]:
try:
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + comment["username"] + "/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/"+ comment["username"] + "/pseuds/" + comment["pseud"].replace(" ","%20") + "\"><b>" + comment["pseud"] + " (" + comment["username"] + ")</b></a></span>")
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + comment["username"] + "/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/" + comment["username"] + "/pseuds/" + comment["pseud"].replace(" ","%20") + "\"><b>" + comment["pseud"] + " (" + comment["username"] + ")</b></a></span>")
except:
filewrite.write("<span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/" + comment["username"] + "/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/"+ comment["username"] + "\"><b>" + comment["username"] + "</b></a></span>")
else:

@ -1,6 +1,6 @@
import datetime
title = ""
title = "" # just the number is fine
showtitle = False
language = "en"
# translation =
@ -24,7 +24,7 @@ location = [""]
# locationtext = ""
# summary = ""
# notes = ""
# event = "" # challenge (including fests), ao3exchange, exchange, prompt
# event = "" # challenge (including fests; anything without a specific prompt), ao3exchange, exchange, prompt
# eventlocation = "" # dwcomm, dwjournal, ljjournal
# eventname = ""
# eventdeets = "" # probably not needed unless its robotsoup
@ -39,8 +39,8 @@ locked = False
html = True
pdf = True
epub = True
# comments = [{"site":"", # ao3, dw, lj
# "registered":, # True or False
# comments = [{"site":"", # ao3, dw, lj, discord
# "registered":, # True or False, not required for discord
# "username":"", # leave out if its a dw/lj anon
# "pseud":"", # optional, ao3 only
# "date":datetime.datetime(),

Loading…
Cancel
Save