An SMS bot that:
- Registers a user via sms
- Analyzes sentiment (positive or negative) on incoming SMS
- Generates unique poems from shakespeare sonnets
- Generates images of those sonnets
This was built using:
- Express.js
- Mongoose
- Node.js & npm
- twilio-node: a node helper library for the Twilio REST API
- The IBM Watson add-on for Twilio Messages
- PoetryDB
- node-gd (an image manipulation library)
This project is build using Express web framework and depends on MongoDB.
-
First clone this repository and
cdinto it.$ git clone git@github.com:jarodreyes/shakespeare.git $ cd shakespeare -
Install the requirements.
$ npm install
-
Start the server.
$ npm start
-
Check it out at http://localhost:3000.
- Expose your application to the wider internet using ngrok. You can click here for more details. This step is important because the application won't work as expected if you run it through localhost.
$ ngrok http 3000Once ngrok is running, open up your browser and go to your ngrok URL. It will
look something like this: http://9a159ccf.ngrok.io
- Configure Twilio to call your webhooks.
You will also need to configure Twilio to call your application when calls are received on your Twilio Number. The SMS & MMS Request URL should look something like this:
http://<sub-domain>.ngrok.io/shakespeare/incoming
-
Text your twilio number "Hello".
-
Should get the following response:
Hello, I am Shakespeare. It would be heavenly to assist ye. First question, what be thy first name?: -
Reply with your name...
-
After registration is complete text a poem of your own to shakespeare or type 'SONNET' to receive a custom sonnet:
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio's Team 37: A labratory for inspiring ideas.
