forked from MarseyWorld/MarseyWorld
remove bot mentions
parent
95f4f42ed2
commit
d07a6cbc08
|
@ -36,13 +36,12 @@ def get_mentions(queries):
|
||||||
mentions = []
|
mentions = []
|
||||||
for kind, query in itertools.product(kinds, queries):
|
for kind, query in itertools.product(kinds, queries):
|
||||||
try:
|
try:
|
||||||
data = requests.get(f'https://api.pushshift.io/reddit/{kind}/search?html_decode=true&q={query}&size=1', timeout=5).json()['data']
|
# Special cases: PokemonGoRaids says 'Marsey' a lot unrelated to us.
|
||||||
|
# SubSimulatorGPT2 is just bots
|
||||||
|
data = requests.get(f'https://api.pushshift.io/reddit/{kind}/search?html_decode=true&q={query}&subreddit=!PokemonGoRaids,!SubSimulatorGPT2&size=1', timeout=5).json()['data']
|
||||||
except: break
|
except: break
|
||||||
|
|
||||||
for i in data:
|
for i in data:
|
||||||
# Special case: PokemonGoRaids says 'Marsey' a lot unrelated to us.
|
|
||||||
if i['subreddit'] == 'PokemonGoRaids': continue
|
|
||||||
|
|
||||||
if kind == 'comment':
|
if kind == 'comment':
|
||||||
body = i["body"].replace('>', '> ')
|
body = i["body"].replace('>', '> ')
|
||||||
text = f'<blockquote><p>{body}</p></blockquote>'
|
text = f'<blockquote><p>{body}</p></blockquote>'
|
||||||
|
|
Loading…
Reference in New Issue