Serverless Framework function that periodically deletes a user's Reddit comments below a defined threshold!
-
Follow the Serverless Framework AWS - Installation guide to setup Serverless Framework and AWS credentials in your development environment.
-
Set
functions.reddelete.events.scheduleinserverless.ymlbased on the Schedule Expressions for Rules guide (default is every six hours) -
Set
functions.reddelete.environmentinserverless.ymlas follows:REDDIT_CLIENT_ID: create an app on RedditREDDIT_CLIENT_SECRET: from Reddit app created aboveREDDIT_USERNAME: Reddit usernameREDDIT_PASSWORD: Reddit passwordDELETE_THRESHOLD: Comments with score below this are deleted (default is 0)
Suggested method for seting these values: Reference Variables using the SSM Parameter Store
-
serverless deploy -
Done!
This function is based on AWS Python Scheduled Cron Example