• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to parse SMS and send customized response

josetann

Lurker
I have a need to respond to an SMS whether I'm at the phone or not.

The SMS will be something along the lines of:

ABC shift available: Monday 02/23/2015 07:30->16:30 NAME_OF_SHIFT REPLY "398" TO CONFIRM Your booking will be confirmed by another SMS.

The text comes in the day before a shift. If you're at work when the text comes in, you can't respond, and you'll lose out on getting to work the next day. So I'd like a way to look at the text, see if it matches certain conditions, then respond if desired. Ideally I could have it check several things; if the "NAME_OF_SHIFT" is one I'd like, it can ignore the rest of the message, I definitely want to take it. If "NAME_OF_SHIFT" is one I'm not as fond of, it can look at the time listed (i.e. 07:30->16:30 would be accepted, but not a 20:30-07:30). Once it's done its parsing, if it matches my "YES, DEFINITELY!" criteria, it'll look for the three digit number in quotation marks and will send a reply with that as the message. Then I just need to check the phone at the end of the day and see what shift it signed me up for.

*While I don't think their system would try to double-book someone, it wouldn't be a bad idea to limit auto-responses to one per day.
 
Not looking for a ready-to-go solution (though I surely wouldn't mind one!). I don't see many sms plugins for tasker that are reported to work (I should set aside a few hours and see what I can come up with). Help in that direction would be great.

I "think" I could figure out the variables (since the texts have been identical so far, except for the shift details, sending number and the three-digit code I need to reply with). Hopefully I could figure out how to keep it from sending multiple responses per day. It'd be even better if I could figure out how to delay a response to shifts I don't like as much; so if there's an offer for "Sucky Shift" it could wait a predetermined amount of time (15 minutes, 4 hours, whatever) and if there has been no offer for "Awesome Shift", it'd go ahead and respond to the sucky one.

And of course it needs to send a response. Hopefully a plugin that lets it read SMS will let it send. Or maybe I'm making this harder than it is. I need to dive into the documentation again, it's been a while.
 
Back
Top Bottom