https://github.com/phdenzel/twilio-sms-bot
An SMS bot using the Twilio API
https://github.com/phdenzel/twilio-sms-bot
flask-application python twilio-sms-api virtualenv
Last synced: 11 months ago
JSON representation
An SMS bot using the Twilio API
- Host: GitHub
- URL: https://github.com/phdenzel/twilio-sms-bot
- Owner: phdenzel
- License: mit
- Created: 2017-06-21T17:40:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-22T07:26:45.000Z (about 9 years ago)
- Last Synced: 2025-06-11T10:47:46.743Z (about 1 year ago)
- Topics: flask-application, python, twilio-sms-api, virtualenv
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: twilio-sms-bot
#+AUTHOR: phdenzel
*** Install
To install the ~twilio-sms-bot~ simply run the ~install.sh~ script like so
#+BEGIN_SRC shell
./install.sh
#+END_SRC
This will start a virtual python environment and installs all necessary
python modules.
However, for this to work ~virtualenv~ (and ~python~ for that matter) is
required.
A ~python~ install tutorial is easy enough to find with Google... for a
local install go to [https://github.com/phdenzel/local-python-install].
For ~virtualenv~ type
#+BEGIN_SRC shell
pip install virtualenv
#+END_SRC
or something equivalent.
*** Requirements
The ~twilio-sms-bot~ requires a Twilio API Key.
You can sign up for a trial account at [https://www.twilio.com/] by
pressing "Get a free API key".
To make the app accessible over the WWW, we furthermore need to download
~ngrok~ at [https://ngrok.com/download].
*** Run the bot
To start the bot type
#+BEGIN_SRC shell
source venv/bin/activate
python run-bot.py
#+END_SRC
This runs the bot in your local host.
Open another terminal and run ~ngrok~
#+BEGIN_SRC shell
ngrok http
#+END_SRC
replace ~~ by the port number (the number after the colon in local
host address ~http://127.0.0.1:5000~, in this case 5000).
Copy the forwarding HTTPS address and paste it into your Twilio messaging
webhook text field (if you haven't done so, choose a number (sms enabled),
on the "Console Dashboard", click on "Manage Numbers", click on your
number, and find the text field under "Messaging: A message comes in").
*** More
To fully customize the ~twilio-sms-bot~, add more features/API calls to the
~formulate_reply~ function yourself.