This guide revolves around a basic twitter bot implementation which posts a single tweet to the same twitter account every 6 hours.
It allows any Node script (or other if you fancy doing the work to get PHP/Python etc running) to be triggered on any schedule, from every minute to once every year.
Several steps are involved in getting this all up and running:
- Get our Twitter auth details
- Write our bot code
- Create the Lambda in AWS Console
- Add Environmental variables to keep our security details safe
- Test our Lambda function
- Set up a Cloudwatch trigger to act as the scheduler
- Confirm the schedule is running as expected
Get our Twitter auth details
Open developer.twitter.com and consider which account you’re going to post tweets to.
You may need to sign up and verify your account. Do all that, or just login.
Once you’re in create a new app. Click to create or view keys / access details and ensure you have an App Token, App Secret, User Secret and User Token. So four hashes in total. Two tokens and two secrets.
Also check that your user details have read and write access so we can post tweet updates.Continue reading “Creating a scheduled Lambda or Lambda Cron”