Skip to content

Commit

Permalink
Merge pull request #35 from jnewland/twilio-fixes
Browse files Browse the repository at this point in the history
Twilio fixes
  • Loading branch information
atmos committed Oct 26, 2011
2 parents 076420a + 3e199b3 commit 2cd7331
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hubot/twilio.coffee
Expand Up @@ -23,6 +23,9 @@ class Twilio extends Robot
strings.forEach (str) =>
@send user, "#{user.name}: #{str}"

respond: (regex, callback) ->
@hear regex, callback

run: ->
console.log "Hubot: the SMS reader."

Expand All @@ -34,7 +37,7 @@ class Twilio extends Robot
response.writeHead 200, 'Content-Type': 'text/plain'
response.end()

server.listen process.env.HUBOT_SMS_PORT, "0.0.0.0"
server.listen (parseInt(process.env.HUBOT_SMS_PORT) || 8080), "0.0.0.0"

handle: (body, from) ->
return if body.length == 0
Expand Down
2 changes: 2 additions & 0 deletions src/templates/README.md
Expand Up @@ -96,6 +96,8 @@ receive SMS messages.

% heroku config:add HUBOT_SMS_TOKEN="4ada63e18146a204e468fb6289030231"

After getting Hubot up and running, update the "SMS Request URL" for your
Twilio number to point to your Hubot instance.

Restart the bot
---------------
Expand Down

0 comments on commit 2cd7331

Please sign in to comment.