diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | SmallYTChannelDatabase.db | bin | 2658304 -> 3139584 bytes | |||
-rw-r--r-- | readme.md | 47 |
3 files changed, 48 insertions, 1 deletions
@@ -2,7 +2,7 @@ login.py graph.png pid.txt ch.py -chblacklist.py +chblacklist.txt # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/SmallYTChannelDatabase.db b/SmallYTChannelDatabase.db Binary files differindex 09edf90..b5cf367 100644 --- a/SmallYTChannelDatabase.db +++ b/SmallYTChannelDatabase.db 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`. |