-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
37 lines (28 loc) · 880 Bytes
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import praw
import time
import logging
from config import *
logging.basicConfig(filename="SubMembers.log",
format='%(asctime)s %(message)s',
filemode='w')
logger=logging.getLogger()
logger.setLevel(logging.INFO)
reddit = praw.Reddit(
client_id=CLid,
client_secret=CLscrt,
user_agent="subreddit member amount scraper 1.5 by u/Pos3odon08",
)
subreddit = reddit.subreddit(sub)
print("Author = u/Pos3odon08")
while True:
now = datetime.now()
subs = reddit.subreddit(sub).subscribers
current_time = now.strftime("%Hh %Mm %Ss")
print("\033[1;93m",subreddit.display_name, end= '')
print(" subs", subs, end= '')
print(" 🕒 =", current_time)
logger.info("--------HERE--------")
logger.info(subs)
logger.info(current_time)
logger.info("--------------------")
time.sleep(60) #time between checks is set to one minute (60 seconds)