A Twilio application that serves as the Dungeon Master's SMS companion, providing a text interface to random dice rolling.
[] (http://travis-ci.org/RobSpectre/25-Lines-SMS-Dicebag)
A little stressed out one afternoon in the office, I decided to whip up another Twilio 25-liner like the SMS Weather I put together earlier in the week. Same rules applied here as the weather app, and I gave myself 50 total minutes to complete:
- It had to do something significant. Couldn't be something silly like Laughotron.
- Start to finish in no more than 25 lines, including whitespace.
- It had to pass my PEP8 vim plugin. No crazy single-line, more than 80 column shenanigans.
- Application had to be code complete by the time Super Marios Brothers alarm clock went off.
- It must withstand a reasonable amount of poor user input - no brittleware.
To accomplish this, I busted out the Twilio Hackpack for Heroku and Flask and my second ed DMG.
Text anything to (646) 606-2920 to see it work!
Step-by-step on how to deploy and develop this app.
- Grab latest source
git clone git://github.com/RobSpectre/25-Lines-SMS-Dicebag.git
- Install dependencies
make init
- Navigate to folder and create new Heroku Cedar app
heroku create --stack cedar
- Deploy to Heroku
git push heroku master
- Scale your dynos
heroku scale web=1
- Configure a new TwiML app and Twilio phone number to use the app.
python configure.py --account_sid ACxxxxxx --auth_token yyyyyyy -n -N
- Text the new number and roll your next character!
Be sure to follow the configuration steps above and use this step-by-step guide to tweak to your heart's content.
- Install the dependencies.
make init
- Launch local development webserver
foreman start
-
Open browser to http://localhost:5000.
-
Tweak away on
app.py
.
Damn straight this dice bag is tested. We know how important those stat rolls are.
make test
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio New York