Skip to content

losttime/gdg-twilio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gdg-twilio

This code was developed as part of a coding challenge that took place at the GDG Utah meeting on February 7, 2013. We were asked to complete a series of tasks utilizing the Twilio API and upload our code to GitHub. The code has since been modified to easily deploy to heroku.

Dependencies

  • Python 2.? (not really sure - developed with 2.7.3)
  • twilio-python (Official Twilio SDK for Python)
  • bottle (simple micro-framework for small web applications)

Requirements

  • A Twilio account.
  • A web accessible server capable of running python scripts.
    • Code has been refactored for easy deployment to heroku.

How To Run (general)

  1. Configure variables in server.py according to your setup
  • webserver information (host, port, dns)
  • Twilio information (account, token, phone number)
  1. Configure your Twilio SMS Request URL to point to your webserver at http://www.example.com/smsReceived.
  2. Upload server.py to a webserver and run it, making sure it's publicly accessible.
  3. Point your browser to your webserver to send an SMS message.

How To Run (heroku)

  1. Create a new heroku app.
  2. Copy set_configs_sample.sh to set_configs.sh
  3. Modify the variables in set_configs.sh to match your setup
  • HOST should likely be 0.0.0.0
  • DNS should be the domain for your new heroku app
  • The rest should match your Twilio account information
  1. Run set_configs.sh to set your heroku app's environment variables

    $ ./set_configs.sh

  2. Push your app to heroku

    $ git push heroku master

  3. Configure your Twilio SMS Request URL to point to your app

  1. Point your browser to your app to send an SMS message.

How To Run (Google App Engine)

  1. Create a new Google App Engine app
  2. Copy the following module dependencies in to the modules/ directory
  • These should take the structure:

    modules/ --httplib2/ --(all the stuff in the httplib2 module) --twilio/ --(all the stuff in the twilio module) --bottle.py --six.py

  1. Update app.yaml with the name of your Google App Engine app
  2. Configure variables in server.py according to your setup
  • webserver information (host, port, dns) is not needed
  • Twilio information (account, token, phone number) is needed
  1. Configure your Twilio SMS Request URL to point to your Google App Engine domain at http://appname.appspot.com/smsReceived.

  2. Deploy your app to Google App Engine

    appcfg.py update appname/

  3. Point your browser to your app to send an SMS message.

About

Code from Google Developer Group meeting Twilio code challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors