Fix weird post bug, also reduce chance of phrases

pull/156/head
Chuck Sneed 2023-06-21 21:23:07 -05:00
parent 23c8d5d578
commit a98590ac0d
2 changed files with 7 additions and 3 deletions

View File

@ -101,6 +101,7 @@ AJ_REPLACEMENTS = {
'EVERYBODY': 'EVERYPONY',
}
PHRASE_CHANCE = 0.5
GIRL_PHRASES = [
"ok so $",
"um $",

View File

@ -703,8 +703,11 @@ def torture_queen(string, key):
string = more_than_one_comma_regex.sub(",", string)
if string[-5:] == ', and':
string = string[:-5]
girl_phrase = GIRL_PHRASES[key%len(GIRL_PHRASES)]
string = girl_phrase.replace("$", string)
random.seed(key)
if random.random() < PHRASE_CHANCE:
girl_phrase = random.choice(GIRL_PHRASES)
string = girl_phrase.replace("$", string)
string = initial + string
return string
@ -716,7 +719,7 @@ def torture_object(obj, torture_method):
i = 0
for tag in tags:
i+=1
key = obj.id*i
key = obj.id+i
tag.string.replace_with(torture_method(tag.string, key))
obj.body_html = str(soup).replace('<html><body>','').replace('</body></html>','')