GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Currently there is no way to send a query string like DateSent<=YYY-MM-DD as noted in the API, specifically for getting SMS messages. (http://www.twilio.com/docs/api/rest/sms) This fixes that.
Adding in the <= and >= to the query string for date ranges
Thanks for catching this. I had completely forgotten about the inequality magic that the API allows.
My only concern is that this ends up cgi-escaping the '>=' or '<=' and I'm not sure how that will behave when received by the API. Also setting up a regex seems unnecessary to just check for a trailing '>=' or '<=', but maybe it's faster?
In fact, now that I think about it, doesn't the current library "just work" if you pass something like:
@sms.list :'DateSent<' => '2012-04-09'
Thanks for the review of this request, your last point is valid although I added the functionality for clarity's sake. The encoding of the query string should be handled correctly (my testing shows so). And it is a little faster since we are only performing one loop + a compiled regex (however the speed increase is minimal in this case). Up to your style guide to accept or close, either way thanks for the consideration.
I think I'd rather not add code to clarify something that does currently work, even if the usage of <= and >= is a little clunky/unclear.
Merge pull request #22 from TwilioDevEd/add-twiml-voice-snippets
Add voice queue TwiML snippets