Add femslashfete to the prompt scraper

master
trémeur 7 months ago
parent ed6f42a2ae
commit 7fb654821e

@ -242,6 +242,27 @@ try:
except:
pass
try:
with requests.Session() as s:
response = s.post(login_url , data)
fsf = "https://femslashfete.dreamwidth.org/tag/admin?style=light&tag=admin"
fsfpage = s.get(fsf)
fsfsoup = BeautifulSoup(fsfpage.content, "html.parser")
fsfprompts = fsfsoup.find_all("h3", string=lambda text: "challenge" in text.lower())
fsfsubsoup = BeautifulSoup(str(fsfprompts[0]), "html.parser")
fsfurl = fsfsubsoup.find("a")
fsfprompt = (fsfurl["href"])
fsfpromptnew = (fsfurl["href"] + "?style=light")
fsfpromptpage = s.get(fsfpromptnew)
fsfpromptsoup = BeautifulSoup(fsfpromptpage.content, "html.parser")
fsfprompttext = fsfpromptsoup.find(class_="entry-content")
fsftheprompt = fsfprompttext.find("b")
print("femslashfete (at least 100 words, must be femslash): \033[1m" + fsftheprompt.text.lower() + "\033[0m (" + fsfprompt + ")\n")
thefile.write("- [[" + fsfprompt + "][femslashfete]] (at least 100 words, must be femslash): *" + fsftheprompt.text.lower() + "*\n")
prompts.append({"source":"femslashfete","type":"comm","notes":"at least 100 words, must be femslash","prompt":fsftheprompt.text.lower(),"url":fsfprompt})
except:
pass
# seems dead
# try:
# femslash = "https://femslashficlets.dreamwidth.org/tag/challenges?style=light&tag=challenges"
@ -447,7 +468,7 @@ if themonth != 4 and themonth != 8 and themonth != 12:
sspictureprompttext = sspicturepromptsoup.find("h3")
print("sweet and short picture prompts (up to 300 words): \033[1m" + sspictureprompttext.text.lower() + "\033[0m (" + sspictureprompt + ")\n")
thefile.write("- [[" + sspictureprompt + "][sweet and short picture prompts]] (up to 300 words): *" + sspictureprompttext.text.lower() + "*\n")
prompts.append({"source":"sweetandshort","type":"comm","notes":"up to 300 words","prompt":sspictureprompttext.text.lower(),"url":sspictureprompts,"challenge":"picture prompt fun"})
prompts.append({"source":"sweetandshort","type":"comm","notes":"up to 300 words","prompt":sspictureprompttext.text.lower(),"url":sspictureprompt,"challenge":"picture prompt fun"})
except:
pass

Loading…
Cancel
Save