addded new code and reqs

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-07-05 13:50:53 +02:00
parent a85f5a04a5
commit 21d43e906e
2 changed files with 15 additions and 5 deletions

2
requirements.txt 100644
View File

@ -0,0 +1,2 @@
praw==7.5.0
requests==2.27.1

View File

@ -1,8 +1,12 @@
try:
import time
import requests
import praw
import os
import json
except ImportError:
print("Please install the required python modules with pip install -r requirements.txt or pip3 install -r requirements.txt!")
exit()
current_time = time.strftime("%H-%M-%S")
current_path = os.path.dirname(os.path.realpath(__file__))
@ -13,6 +17,10 @@ nswf = False
def debugging_message(message : str):
print("["+current_time+"][DEBUG] "+message)
if not os.path.isfile(current_path+"/used-posts.json"):
with open(current_path+"/used-posts.json", "w") as used_posts_file:
json.dump({"ids": []}, used_posts_file)
reddit = praw.Reddit(client_id="TB3qNrAO2cnRkpmI-Vd8hg",
client_secret="AO61coSKJ8O8KLlHAqP6W-nvufdgUw",
user_agent="Meme of the day"