From c8821e937f3dbca0841bd57bf6430c73498f69f2 Mon Sep 17 00:00:00 2001 From: jwansek Date: Fri, 15 Mar 2019 19:57:16 +0000 Subject: added readme --- readme.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 readme.md (limited to 'readme.md') diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..0141239 --- /dev/null +++ b/readme.md @@ -0,0 +1,47 @@ +# /u/SmallYTChannelBot Source Code + +- SmallYTChannelBotSubmissions.py is where the main code is kept. It has the +main subreddit stream in it. + +- SmallYTChannelDatabase.db is an SQLite file containing the database. I chose +SQLite over MySQL since it's easier to backup. Maybe one day we'll upgrade to +MySQL and do automated backups. + +- database.py is a class for interfacing with the database. + +- onceaday.py is a file which calls a function in the main prog every 24h +to do statistcs stuff, drawing the graphs etc. + +- runprog.py calls the main program. The way it does this is kinda alkward, +because it kills the main program and restarts it every 2h. I don't even know +if this is needed anymore but it fixed problems so it stays. It works because +the main prog writes its pid in a text file every time it's called. This pid +is called after 2h and a new instance is started. + +- ytapi.py gets data about user's videos in the subreddit to do the stats comment +and do the flair. + +- Not included for security reasons is login.py which has the PRAW instance and +API keys for imgur. The YT api key is in ytapi.py for some reason. Hope that +isn't a massive problem. + +If you're looking at this because you think I'm dead, the bot is running on an +AWS instance that expires in November 2019, you'll need to find a new host +before then. The backup is probably out of date, so you'll need to write a script +that parses the subreddit and gets everyone's lambda scores from their flair. + +#TODOs + +- Ignore bot commands when they're formatted as code (` or indentation) + +- Write a bot for the discord + +- Automate backups + +#About the database's structure + +`users` is where usernames and the scores are kept. `lambdas` is for every +time a lambda is given. Is linked to `users`. `stats` keeps unique users (just +the amount of users in `users`), the total lambda in circulation (everyone's +lambda scores summed), and the times help given, which is just the sum of every +unique entry in `lambdas`. -- cgit v1.2.3