/25-Lines-SMS-Dicebag

The tiny Twilio application for the discriminating Dungeon Master.

Primary LanguagePythonMIT LicenseMIT

25 Lines - SMS Dice Bag

A Twilio application that serves as the Dungeon Master's SMS companion, providing a text interface to random dice rolling.

[Build Status] (http://travis-ci.org/RobSpectre/25-Lines-SMS-Dicebag)

Summary

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.

Usage

Text anything to (646) 606-2920 to see it work!

Example of it working

Installation

Step-by-step on how to deploy and develop this app.

Deploy

  1. Grab latest source
git clone git://github.com/RobSpectre/25-Lines-SMS-Dicebag.git 
  1. Install dependencies
make init
  1. Navigate to folder and create new Heroku Cedar app
heroku create --stack cedar
  1. Deploy to Heroku
git push heroku master
  1. Scale your dynos
heroku scale web=1
  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
  1. Text the new number and roll your next character!

Development

Be sure to follow the configuration steps above and use this step-by-step guide to tweak to your heart's content.

  1. Install the dependencies.
make init
  1. Launch local development webserver
foreman start
  1. Open browser to http://localhost:5000.

  2. Tweak away on app.py.

Testing

Damn straight this dice bag is tested. We know how important those stat rolls are.

make test

Meta

githalytics.com alpha