Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Parse the body input message. #8

Open
3 tasks
qwo opened this issue Nov 9, 2014 · 3 comments
Open
3 tasks

Parse the body input message. #8

qwo opened this issue Nov 9, 2014 · 3 comments

Comments

@qwo
Copy link
Member

qwo commented Nov 9, 2014

Parse the body input message. Here is an example response.

Should handle terms like

  • "help"
  • "111 Granby st"
  • stop numbers like "8004"
2014-11-09T19:30:46.683157+00:00 app[web.1]: ****DEBUGGING***
2014-11-09T19:30:46.683394+00:00 app[web.1]: { host: 'hrtbus.herokuapp.com',
2014-11-09T19:30:46.683399+00:00 app[web.1]:   accept: '*/*',
2014-11-09T19:30:46.683397+00:00 app[web.1]:   connection: 'close',
2014-11-09T19:30:46.683400+00:00 app[web.1]:   'cache-control': 'max-age=259200',
2014-11-09T19:30:46.683408+00:00 app[web.1]:   'x-forwarded-for': '54.224.170.105',
2014-11-09T19:30:46.683402+00:00 app[web.1]:   'content-type': 'application/x-www-form-urlencoded',
2014-11-09T19:30:46.683407+00:00 app[web.1]:   'x-request-id': 'cbbc9466-32f4-4877-8c0d-04d293fd63b2',
2014-11-09T19:30:46.683411+00:00 app[web.1]:   'x-forwarded-port': '80',
2014-11-09T19:30:46.683409+00:00 app[web.1]:   'x-forwarded-proto': 'http',
2014-11-09T19:30:46.683404+00:00 app[web.1]:   'user-agent': 'TwilioProxy/1.1',
2014-11-09T19:30:46.683405+00:00 app[web.1]:   'x-twilio-signature': 'n1iD5bcqbR/OhYjovKk6ZOu9J0k=',
2014-11-09T19:30:46.683925+00:00 app[web.1]:   ToState: 'VA',
2014-11-09T19:30:46.683927+00:00 app[web.1]:   SmsMessageSid: 'SMc721c1cbd868618b19c46a9f5f1468d8',
2014-11-09T19:30:46.683414+00:00 app[web.1]:   'connect-time': '0',
2014-11-09T19:30:46.683936+00:00 app[web.1]:   SmsStatus: 'received',
2014-11-09T19:30:46.683418+00:00 app[web.1]:   'content-length': '382' }
2014-11-09T19:30:46.683423+00:00 app[web.1]: {}
2014-11-09T19:30:46.683931+00:00 app[web.1]:   ToCity: '',
2014-11-09T19:30:46.683932+00:00 app[web.1]:   FromZip: '10013',
2014-11-09T19:30:46.683416+00:00 app[web.1]:   'total-route-time': '0',
2014-11-09T19:30:46.683939+00:00 app[web.1]:   Body: 'Jhjch',
2014-11-09T19:30:46.683935+00:00 app[web.1]:   FromState: 'NY',
2014-11-09T19:30:46.683933+00:00 app[web.1]:   SmsSid: 'SMc721c1cbd868618b19c46a9f5f1468d8',
2014-11-09T19:30:46.683928+00:00 app[web.1]:   NumMedia: '0',
2014-11-09T19:30:46.683415+00:00 app[web.1]:   'x-request-start': '1415561446675',
2014-11-09T19:30:46.683938+00:00 app[web.1]:   FromCity: 'NEW YORK',
2014-11-09T19:30:46.683412+00:00 app[web.1]:   via: '1.1 vegur',
2014-11-09T19:30:46.683941+00:00 app[web.1]:   FromCountry: 'US',
2014-11-09T19:30:46.683923+00:00 app[web.1]: { ToCountry: 'US',
2014-11-09T19:30:46.683949+00:00 app[web.1]:   ApiVersion: '2010-04-01' }
2014-11-09T19:30:46.683945+00:00 app[web.1]:   MessageSid: 'SMc721c1cbd868618b19c46a9f5f1468d8',
2014-11-09T19:30:46.683947+00:00 app[web.1]:   AccountSid: 'AC5d12403539042879555e4856a6576ef7',
2014-11-09T19:30:46.683948+00:00 app[web.1]:   From: '+13473993732',
2014-11-09T19:30:46.683942+00:00 app[web.1]:   To: '+17579135000',
2014-11-09T19:30:46.683944+00:00 app[web.1]:   ToZip: '',
2014-11-09T19:30:46.683982+00:00 app[web.1]: {}
2014-11-09T19:30:46.683954+00:00 app[web.1]: form undefined
@qwo qwo added the enhancement label Nov 9, 2014
@qwo qwo assigned ghost Nov 9, 2014
@qwo qwo changed the title Example Response Parse the body input message. Nov 9, 2014
@ghost
Copy link

ghost commented Nov 11, 2014

Regarding "help:" it seems Twilio reserves help as a keyword, so we can't exactly use that one, but I did default anything other than stop numbers to the current help message instead. Not sure if that suffices for that message or not.

@qwo
Copy link
Member Author

qwo commented Dec 16, 2014

we could go spanish and use "ayudame!" or use a default response as a helpful message.

@ghost
Copy link

ghost commented Dec 17, 2014

hahaha, we could. Or Polish: pomoc!

I don't know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant