Open external links in new tabs, set correct dates for RSS feed

This commit is contained in:
mez 2025-02-01 14:29:09 +00:00
parent 6502979225
commit 1830a5f64d
7 changed files with 47 additions and 39 deletions

View file

@ -476,13 +476,13 @@ def yeargen(local=False):
for event in neweventslist:
filewrite.write("<tr>\n<th>")
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":
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":
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 href=\"https://ficwip.carrd.co\">#ficwip</a>")
filewrite.write("<a target=\"_blank\" href=\"https://ficwip.carrd.co\">#ficwip</a>")
else:
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")
@ -493,11 +493,11 @@ def yeargen(local=False):
for event in neweventslist:
filewrite.write("<h3>")
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":
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":
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:
filewrite.write(event["eventname"])
filewrite.write("</h3>\n<ol>\n")
@ -755,7 +755,7 @@ def yeargen(local=False):
filewrite.write("\">" + str(nextyear) + " »</a></span>")
except:
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()
if __name__ == "__main__":