Created
February 28, 2022 03:15
-
-
Save notesbot/dd067706f4ea2c3287a8acf7be2f6017 to your computer and use it in GitHub Desktop.
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
import praw | |
import time | |
from datetime import datetime as datetime | |
def login(): | |
reddit = praw.Reddit( | |
user_agent = "USER_AGENT", | |
client_id = 'CLIENT_ID', | |
client_secret = 'CIENT_SECRET', | |
refresh_token = 'TOKEN' | |
) | |
return reddit | |
time.time() | |
def how_many_items(subreddit): | |
modqueue = subreddit.mod.modqueue(limit=1000) | |
reported_items = subreddit.mod.reports(limit=1000) | |
num = len(list(reported_items)) | |
unmod = len(list(modqueue)) | |
right_now = time.time() | |
time_stamp = datetime.fromtimestamp(int(right_now)).strftime('%a, %B %d, %Y at %H:%M:%S') | |
print(f'\n\n{time_stamp}') | |
print('====================================') | |
print(f'-> {num} reported items and\n-> {unmod} items in modqueue remaining.') | |
print('====================================') | |
###################################### | |
if __name__ == "__main__": | |
reddit = login() | |
subreddit = reddit.subreddit('news') | |
count_things = how_many_items(subreddit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment