remotes/1693045480750635534/spooky-22
Aevann1 2021-09-28 05:59:33 +02:00
parent ca3f232a45
commit 800acd97e0
3 changed files with 115 additions and 38 deletions

View File

@ -4,7 +4,7 @@ from flask import *
from sqlalchemy import *
from sqlalchemy.orm import relationship, deferred
from files.helpers.lazy import lazy
from files.helpers.const import SLURS, replace_keep_case
from files.helpers.const import SLURS
from files.__main__ import Base
from .flags import CommentFlag
from os import environ
@ -286,8 +286,8 @@ class Comment(Base):
if not body: return ""
if not v or v.slurreplacer:
for s, r in SLURS.items(): body = replace_keep_case(f"{s} ", f"{r} ", replace_keep_case(f" {s}", f" {r}", body))
if not v or v.slurreplacer:
for s, r in SLURS.items(): body = body.replace(s, r)
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")

View File

@ -4,7 +4,7 @@ from sqlalchemy.orm import relationship, deferred
import re, random
from urllib.parse import urlparse
from files.helpers.lazy import lazy
from files.helpers.const import SLURS, replace_keep_case
from files.helpers.const import SLURS
from files.__main__ import Base
from .flags import *
from os import environ
@ -344,7 +344,7 @@ class Submission(Base):
if not v or v.slurreplacer:
for s,r in SLURS.items():
body = replace_keep_case(f"{s} ", f"{r} ", replace_keep_case(f" {s}", f" {r}", body))
body = body.replace(s, r)
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
@ -357,7 +357,7 @@ class Submission(Base):
else: title = self.title
if not v or v.slurreplacer:
for s,r in SLURS.items(): title = replace_keep_case(f"{s} ", f"{r} ", replace_keep_case(f" {s}", f" {r}", title))
for s,r in SLURS.items(): title = title.replace(s, r)
return title

View File

@ -1,31 +1,117 @@
from os import environ
import re
site = environ.get("DOMAIN").strip()
SLURS = {
"faggot":"cute twink",
"fag":"cute twink",
"kill yourself":"keep yourself safe",
"nigger":"πŸ€",
"pedophile":"libertarian",
"pedo":"libertarian",
"rapist":"male feminist",
"steve akins":"penny verity oaken",
"trannie":"πŸš‚πŸšƒπŸšƒ",
"tranny":"πŸš‚πŸšƒπŸšƒ",
"troon":"πŸš‚πŸšƒπŸšƒ",
"kike": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X",
"retard":"r-slur",
"janny":"j-slur",
"jannie":"j-slur",
"latinos":"latinx",
"latino":"latinx",
"latinas":"latinx",
"latina":"latinx",
"hispanics":"latinx",
"hispanic":"latinx",
"nig":"πŸ€",
" faggot":" cute twink",
" Faggot":" Cute twink",
" FAGGOT":" CUTE TWINK",
" fag":" cute twink",
" Fag":" Cute twink",
" FAG":" CUTE TWINK",
" kill yourself":" keep yourself safe",
" KILL YOURSELF":" KEEP YOURSELF SAFE",
" nigger":" πŸ€",
" Nigger":" πŸ€",
" NIGGER":" πŸ€",
" pedo":" libertarian",
" Pedo":" Libertarian ",
" PEDO":" LIBERTARIAN ",
" rapist":" male feminist",
" Rapist":" Male feminist",
" RAPIST":" MALE FEMINIST",
" steve akins":" penny verity oaken",
" Steve Akins":" Penny Verity Oaken",
" STEVE AKINS":" PENNY VERITY OAKEN",
" trannie":" πŸš‚πŸšƒπŸšƒ",
" Trannie":" πŸš‚πŸšƒπŸšƒ",
" TRANNIE":" πŸš‚πŸšƒπŸšƒ",
" tranny":" πŸš‚πŸšƒπŸšƒ",
" Tranny":" πŸš‚πŸšƒπŸšƒ",
" TRANNY":" πŸš‚πŸšƒπŸšƒ",
" troon":" πŸš‚πŸšƒπŸšƒ",
" Troon":" πŸš‚πŸšƒπŸšƒ",
" TROON":" πŸš‚πŸšƒπŸšƒ",
" NoNewNormal": " HorseDewormerAddicts",
" nonewnormal": " horsedewormeraddicts",
" Kike": " https://sciencedirect.com/science/article/abs/pii/S016028960600033X",
" kike": " https://sciencedirect.com/science/article/abs/pii/S016028960600033X",
" retard":" r-slur",
" Retard":" R-slur",
" RETARD":" R-SLUR",
" janny":" j-slur",
" Janny":" J-slur",
" JANNY":" J-SLUR",
" jannie":" j-slur",
" Jannie":" J-slur",
" JANNIE":" J-SLUR",
" janny":" j-slur",
" Janny":" J-slur",
" JANNY":" J-SLUR",
" jannie":" j-slur",
" Jannie":" J-slur",
" JANNIE":" J-SLUR",
" latinos":" latinx",
" latino":" latinx",
" latinas":" latinx",
" latina":" latinx",
" hispanics":" latinx",
" hispanic":" latinx",
"faggot ":"cute twink ",
"Faggot ":"Cute twink ",
"FAGGOT ":"CUTE TWINK ",
"fag ":"cute twink ",
"Fag ":"Cute twink ",
"FAG ":"CUTE TWINK ",
"kill yourself ":"keep yourself safe ",
"KILL YOURSELF ":"KEEP YOURSELF SAFE ",
"nigger ":"πŸ€ ",
"Nigger ":"πŸ€ ",
"NIGGER ":"πŸ€ ",
"pedo ":"libertarian ",
"Pedo ":"Libertarian ",
"PEDO ":"LIBERTARIAN ",
"steve akins ":"penny verity oaken ",
"Steve Akins ":"Penny Verity Oaken ",
"STEVE AKINS ":"PENNY VERITY OAKEN ",
"trannie ":"πŸš‚πŸšƒπŸšƒ ",
"Trannie ":"πŸš‚πŸšƒπŸšƒ ",
"TRANNIE ":"πŸš‚πŸšƒπŸšƒ ",
"tranny ":"πŸš‚πŸšƒπŸšƒ ",
"Tranny ":"πŸš‚πŸšƒπŸšƒ ",
"TRANNY ":"πŸš‚πŸšƒπŸšƒ ",
"troon ":"πŸš‚πŸšƒπŸšƒ ",
"Troon ":"πŸš‚πŸšƒπŸšƒ ",
"TROON ":"πŸš‚πŸšƒπŸšƒ ",
"NoNewNormal ": "HorseDewormerAddicts ",
"nonewnormal ": "horsedewormeraddicts ",
"Kike ": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X ",
"kike ": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X ",
"retard ":"r-slur ",
"Retard ":"R-slur ",
"RETARD ":"R-SLUR ",
"janny ":"j-slur ",
"Janny ":"J-slur ",
"JANNY ":"J-SLUR ",
"jannie ":"j-slur ",
"Jannie ":"J-slur ",
"JANNIE ":"J-SLUR ",
"latinos ":"latinx ",
"latino ":"latinx ",
"latinas ":"latinx ",
"latina ":"latinx ",
"hispanics ":"latinx ",
"hispanic ":"latinx ",
" nig ":" πŸ€ ",
" Nig ":" πŸ€ ",
" NIG ":" πŸ€ ",
" nigs ":" πŸ€s ",
" Nigs ":" πŸ€s ",
" NIGS ":" πŸ€s ",
}
LONGPOST_REPLIES = ['Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# 😴😴😴', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him,", '![](https://i.kym-cdn.com/photos/images/newsfeed/001/038/094/0a1.jpg)', 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys 😷😷😷', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit on rdrama.net was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!']
@ -57,12 +143,3 @@ LONGPOSTBOT_ACCOUNT = 1832
PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6'
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()
def replace_keep_case(word, replacement, text):
def func(match):
g = match.group()
if g.islower(): return replacement.lower()
if g.istitle(): return replacement.title()
if g.isupper(): return replacement.upper()
return replacement
return re.sub(word, func, text, flags=re.I)