This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Represent "restricted" subreddits as private & code cleanup #76
Open
MaxDeVos
wants to merge
16
commits into
Tanza3D:main
Choose a base branch
from
MaxDeVos:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DavidCano98 kindly pointed out to me that there is a way to access the subreddit status trivially through a GET request. I will be updating this pull request accordingly. |
I have updated the original pull request message to match the new code. It is ready to be merged. |
I see a number of changes have been made to the main branch, breaking this PR's ability to merge. I am working on catching it up to date. |
# Conflicts: # config.js.example # main.js # package-lock.json
I have locally merged my code with the latest code on |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have implemented a system to detect subreddits that are not accepting submissions and mark them as private accordingly by taking advantage of the details provided at
/r/<subreddit>/about.json
. This strategy allows us to use the same number of requests as the current system to achieve this. Thank you to @DavidCano98 for pointing out the existence ofabout.json
, as it is far more elegant than the xpath-scraping solution I had created beforehand.Many subreddits are opting to restrict submissions instead of privating the subreddit to allow their "protest" mod posts to reach the front page. Many large subreddits are doing this, such as r/Pics, so this fixes an enormous gap in representation.
This pull request also includes a lot of code cleanup, additional comments, and standardization which will make contribution more approachable to others.
The crux of the restriction identification system can be seen in this excerpt: