Created
July 18, 2018 23:52
-
-
Save etnguyen03/5479de1890c6e1de051d91359db2918c to your computer and use it in GitHub Desktop.
Reddit_Aww u/etnguyen03
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
# Reddit_Aww u/etnguyen03 | |
# August 18, 2018 | |
# Writes to RedditAww.txt a comma-separated file of subreddit name and subscriber count | |
# Loops through 1-20 (inclusive) of "w"'s in "aww" for subreddit name | |
# -1 signifies "Subreddit non existent" | |
import praw | |
reddit = praw.Reddit(client_id="REDACTED", client_secret="REDACTED", user_agent="Reddit_AwwBOT") | |
reddit.read_only = True | |
outFile = open("RedditAww.txt", "w") | |
for i in range(1, 21): # so it's 1 "w" to 20 "w"'s | |
try: | |
subredditString = "a" | |
for i in range(0, i): | |
subredditString += "w" | |
subreddit = reddit.subreddit(subredditString) | |
print (subreddit.subscribers) | |
outFile.write(subredditString+","+str(subreddit.subscribers)+"\n") | |
except Exception: | |
outFile.write(subredditString+",-1\n") | |
print (subredditString + " non existent") | |
outFile.close() |
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
aw,-1 | |
aww,17552296 | |
awww,52124 | |
awwww,1080 | |
awwwww,226 | |
awwwwww,162 | |
awwwwwww,85 | |
awwwwwwww,57 | |
awwwwwwwww,44 | |
awwwwwwwwww,44 | |
awwwwwwwwwww,49 | |
awwwwwwwwwwww,39 | |
awwwwwwwwwwwww,44 | |
awwwwwwwwwwwwww,56 | |
awwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwww,14 | |
awwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwww,24 | |
awwwwwwwwwwwwwwwwwww,12 | |
awwwwwwwwwwwwwwwwwwww,74 | |
awwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwwwwwwww,-1 | |
awwwwwwwwwwwwwwwwwwwwwwwwwwwww,-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment