Skip to content

Commit

Permalink
reddit scaling: don't fetch replies to posts that link to user's domain
Browse files Browse the repository at this point in the history
for #1021
  • Loading branch information
snarfed committed Mar 26, 2021
1 parent 8fa41f6 commit 241a4da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def search_for_links(self):
url_query = ' OR '.join([f'site:"{u}" OR selftext:"{u}"' for u in urls])
return self.get_activities(
search_query=url_query, group_id=gr_source.SEARCH, etag=self.last_activities_etag,
fetch_replies=True, fetch_likes=False, fetch_shares=False, count=50)
fetch_replies=False, fetch_likes=False, fetch_shares=False, count=50)

class AuthHandler(util.Handler):
"""Base OAuth handler class."""
Expand Down
3 changes: 3 additions & 0 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ def get_webmention_target(url, resolve=True, replace_test_domains=True):
logging.info('Dropping bad URL %s.', url)
return url, None, False

if domain in ('puzzleadventura.com', 'sweetgamesbox.com'):
return url, domain, False

send = True
if resolve:
# this follows *all* redirects, until the end
Expand Down

0 comments on commit 241a4da

Please sign in to comment.