A Python Twitter bot posting recently active questions from Stack Overflow. Tweaked to run on AWS Lambda.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
oauthlib
requests
requests_oauthlib
stackexchange
tweepy
.gitignore
LICENSE
README.md
screenshot1.png
screenshot2.png
screenshot3.png
six.py
soiq.py
soiq_keys.py
stackauth.py

README.md

soiqbot

A Python based Twitter bot which posts recently active questions from Stack Overflow on an hourly schedule. Tweaked to run on AWS Lambda.
Running Example: https://twitter.com/soiqbot

Prerequisites:

Twitter API key and StackExchange API key

Lambda Setup Notes:

The way Lambda works requires you to include any library dependencies. In this case after you add your keys to soiq_keys.py you would just zip everything for uploading. For other projects you would need to install them locally like: pip install module-name -t /path/to/project-dir

In your AWS console under Lambda, click "Create Lambda Function" and skip the blueprint. Then upload the zip file. The handler is based on the name of your main file + the name of the handler function (which is what Lambda uses to run.)

Our main file is soiq.py and the function name I used is just "handler" so it becomes: soiq.handler
Name

Finally, click "Add event source", go to "CloudWatch Events - Schedule" and set your schedule for it to run there.
Scheduling Schedule

Lambda Docs: http://aws.amazon.com/documentation/lambda

Lambda Pricing (FREE-ish): https://aws.amazon.com/lambda/pricing/