@ -1,4 +1,4 @@
import requests , os
import requests , os , re
from bs4 import BeautifulSoup
from bs4 import BeautifulSoup
from datetime import date , datetime
from datetime import date , datetime
@ -29,12 +29,14 @@ centtheprompt = centprompttext.find("strong")
print ( " 100words (100 words): \033 [1m " + centtheprompt . text . lower ( ) + " \033 [0m ( " + centprompt + " ) \n " )
print ( " 100words (100 words): \033 [1m " + centtheprompt . text . lower ( ) + " \033 [0m ( " + centprompt + " ) \n " )
thefile . write ( " - [[ " + centprompt + " ][100words]] (100 words): * " + centtheprompt . text . lower ( ) + " * \n " )
thefile . write ( " - [[ " + centprompt + " ][100words]] (100 words): * " + centtheprompt . text . lower ( ) + " * \n " )
# for this one we need to extract the right entry from a list, which may be an <ol> but may not be
# for this one we need to extract the right entry from a list, which may be an <ol> but may not be . also, need to use the right month, as next month’ s prompts are posted in advance
today = int ( date . today ( ) . strftime ( " %d " ) )
today = int ( date . today ( ) . strftime ( " %d " ) )
month = str ( date . today ( ) . strftime ( " % B " ) )
monthstring = " .* " + month + " .* "
thirtyone = " https://31-days.dreamwidth.org/tag/!prompts?style=light&tag= % 21prompts "
thirtyone = " https://31-days.dreamwidth.org/tag/!prompts?style=light&tag= % 21prompts "
thirtyonepage = requests . get ( thirtyone )
thirtyonepage = requests . get ( thirtyone )
thirtyonesoup = BeautifulSoup ( thirtyonepage . content , " html.parser " )
thirtyonesoup = BeautifulSoup ( thirtyonepage . content , " html.parser " )
thirtyoneprompts = thirtyonesoup . find_all ( " h3 " , string = lambda text : " prompts " in text . lower ( ) )
thirtyoneprompts = thirtyonesoup . find_all ( " h3 " , string = re . compile ( monthstring ) )
thirtyonesubsoup = BeautifulSoup ( str ( thirtyoneprompts [ 0 ] ) , " html.parser " )
thirtyonesubsoup = BeautifulSoup ( str ( thirtyoneprompts [ 0 ] ) , " html.parser " )
thirtyoneurl = thirtyonesubsoup . find ( " a " )
thirtyoneurl = thirtyonesubsoup . find ( " a " )
thirtyoneprompt = ( thirtyoneurl [ " href " ] )
thirtyoneprompt = ( thirtyoneurl [ " href " ] )
@ -210,8 +212,9 @@ femslashpromptpage = requests.get(femslashpromptnew)
femslashpromptsoup = BeautifulSoup ( femslashpromptpage . content , " html.parser " )
femslashpromptsoup = BeautifulSoup ( femslashpromptpage . content , " html.parser " )
femslashprompttext = femslashpromptsoup . find ( class_ = " entry-content " )
femslashprompttext = femslashpromptsoup . find ( class_ = " entry-content " )
femslashtheprompt = femslashprompttext . find ( " i " )
femslashtheprompt = femslashprompttext . find ( " i " )
print ( " femslash-ficlets (100– 1000 words, F/F): \033 [1m " + femslashtheprompt . text . lower ( ) + " \033 [0m ( " + femslashprompt + " ) \n " )
if femslashtheprompt is not None :
thefile . write ( " - [[ " + femslashprompt + " ][femslashficlets]] (100 words or a multiple of 100): * " + femslashtheprompt . text . lower ( ) + " * \n " )
print ( " femslash-ficlets (100– 1000 words, F/F): \033 [1m " + femslashtheprompt . text . lower ( ) + " \033 [0m ( " + femslashprompt + " ) \n " )
thefile . write ( " - [[ " + femslashprompt + " ][femslashficlets]] (100 words or a multiple of 100): * " + femslashtheprompt . text . lower ( ) + " * \n " )
with requests . Session ( ) as s :
with requests . Session ( ) as s :
response = s . post ( login_url , data )
response = s . post ( login_url , data )