Add (dodgy) boolean for title inclusion in fic headers
This commit is contained in:
parent
b87e0fbfbc
commit
ec80f04586
1 changed files with 8 additions and 3 deletions
|
@ -11,12 +11,14 @@ data = {
|
|||
if os.path.exists("ficheader.html"):
|
||||
os.remove("ficheader.html")
|
||||
|
||||
thefile = open("ficheader.html", "a")
|
||||
thefile = open("ficheader.html", "a")
|
||||
|
||||
with requests.Session() as s:
|
||||
response = s.post(login_url , data)
|
||||
print("Work ID: ")
|
||||
print("Work ID:")
|
||||
id = input()
|
||||
print("Use title? (y/n)")
|
||||
thetitle = input()
|
||||
url = "https://archiveofourown.org/works/" + str(id)
|
||||
ficpage = s.get(url)
|
||||
ficsoup = BeautifulSoup(ficpage.content, "html.parser")
|
||||
|
@ -138,7 +140,10 @@ with requests.Session() as s:
|
|||
mastersoup = BeautifulSoup(masterlist.content, "html.parser")
|
||||
ficno = int(mastersoup.find("span", class_="ficno").text.strip()) + 1
|
||||
thefile.write("<div class=\"fic\" id=\"fic" + str(ficno) + "\">\n")
|
||||
thefile.write(" <h1><span class=\"ficno\">" + str(ficno) + "</span> <span class=\"fictitle\">" + title + "</span></h1>\n")
|
||||
if thetitle == "y":
|
||||
thefile.write(" <h1><span class=\"ficno\">" + str(ficno) + "</span> <span class=\"fictitle\">" + title + "</span></h1>\n")
|
||||
else:
|
||||
thefile.write(" <h1><span class=\"ficno\">" + str(ficno) + "</span></h1>\n")
|
||||
thefile.write(" <ul class=\"ficmeta\">\n")
|
||||
thefile.write(" <li class=\"ficdate\">" + prazedate + "</li>\n")
|
||||
thefile.write(" <li class=\"wordcount\">" + str(words) + "</li>\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue