Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
# title
# url
# flair
# if the url is blacklisted, yeet it.

blacklisted_urls = ["microcenter.com", "bestkorea.kp"]

def get_reddit(subreddit,listing,limit,timeframe):
response = {}

Expand All @@ -74,6 +78,11 @@ def get_reddit(subreddit,listing,limit,timeframe):
title = post['data']['title']
id = post['data']['id'].strip()
url = post['data']['url']

# check if the post URL is blacklisted
if any(blacklisted in url for blacklisted in blacklisted_urls):
continue # bye felicia

if len(post['data']['link_flair_richtext']) == 0:
flair = ""
else:
Expand Down