Add vocab-drabbles
This commit is contained in:
parent
096020c5c8
commit
55b4492954
1 changed files with 15 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue