Sample implementation of Slack Webhook integration using Python and running on Google App Engine
There's no heavy dependency on App Engine. Just remove import ... memcache
and replace httplib2.Http(memcache)
with just httplib2.Http()
and you can run this code on any WSGI app server.
Steps to configure:
- Create Google App Engine project: https://console.developers.google.com
- Call it whatever you want. Your integration point for slack would be either
http://<project-id>.appspot.com/price/<ticker>
orhttp://<project-id>.appspot.com/price
. In the latter case you'd need to specify a ticker name or a list of ticker names when calling the bot on the channel. - Clone this repository
- Run
pip install -r requirements.txt -t lib/ in app subdirectory
- Run
deploy.sh
- Test with curl:
curl -X POST -H "Content-Length: 0" http://<project-id>.appspot.com/price/AAPL
- Go to Integrations configuration in your Slack account
- Configure the above URL as Outgoing Webhook