A Python 3 - serverless app that runs periodically on AWS Lambda to delete old content of yours from Reddit.
This project is built using the serverless framework. The application stack is deployed with the help of a CloudFormation template - some of which is defined it the serverless.yml
file.
A CloudWatch Scheduled Event triggers the Lambda function periodically at an interval as defined in serverless.yml
. handler.py:main
is the entry point for the execution of this app.
The user's credentials are read from the file credentials.ini
, to instantiate a PRAW object which is used to communicate with Reddit.
Configuration of when and which content to delete are read from the file config.yaml
. Some default rules are hardcoded (all content older than 7 days) in the codebase to ensure that the application can be deployed with minimal configuration.
- Install
serverless
,serverless-python-requirements
anddocker
(it is a requirement for the plugin to work correctly). These, and many other useful commands can be found indocs/help.md
. - Copy the contents of
example-credentials.ini
tocredentials.ini
and fill it in. If this is your first time using a PRAW based app, PRAW documentation will help you configure the file. This file name has been added to.gitignore
so that you don't have to worry about accidentally adding your credentials to git history. - Copy the contents of
example-config.yaml
toconfig.yaml
and extend it to set up your own rules on when content should be deleted. - Deploy the app using the command
sls deploy -v
.
- Store metrics of content deleted
- Send a periodic email notification with these metrics