diff --git a/promptscrape.py b/promptscrape.py index 33e7cb1..f9f181b 100644 --- a/promptscrape.py +++ b/promptscrape.py @@ -258,3 +258,18 @@ ficletprompttext = ficletpromptsoup.find(class_="entry-content") ficlettheprompt = ficletprompttext.find("a") print("ficlet-zone (any): \033[1m" + ficlettheprompt.text.lower() + "\033[0m (" + ficletprompt + ")\n") thefile.write("- [[" + ficletprompt + "][ficlet-zone]] (any): *" + ficlettheprompt.text.lower() + "*\n") + +# slightly different format here, taking prompt from the post title +vocab = "https://vocab-drabbles.dreamwidth.org/?style=light&tag=challenge" +vocabpage = requests.get(vocab) +vocabsoup = BeautifulSoup(vocabpage.content, "html.parser") +vocabprompts = vocabsoup.find_all("h3") +vocabsubsoup = BeautifulSoup(str(vocabprompts[0]), "html.parser") +vocaburl = vocabsubsoup.find("a") +vocabprompt = (vocaburl["href"]) +vocabpromptnew = (vocaburl["href"] + "?style=light") +vocabpromptpage = requests.get(vocabpromptnew) +vocabpromptsoup = BeautifulSoup(vocabpromptpage.content, "html.parser") +vocabtheprompt = vocabpromptsoup.find(class_="entry-title") +print("vocab-drabbles (50–500 words): \033[1m" + vocabtheprompt.text.lower() + "\033[0m (" + vocabprompt + ")\n") +thefile.write("- [[" + vocabprompt + "][vocab-drabbles]] (50–500 words): *" + vocabtheprompt.text.lower() + "*\n")