chihacknight / kcbx-petcoke

Monitoring windspeed at the KCBX Petcoke Terminals
MIT License
0 stars 3 forks source link

SMS Notifications #1

Closed justinmanley closed 9 years ago

justinmanley commented 9 years ago

Adds a button enabling residents to subscribe to SMS alerts w/ notifications whenever the wind speed exceeds a predefined threshold.

[[NOT READY TO BE MERGED]] Opening this PR early so we can have a conversation about how this feature should work.

justinmanley commented 9 years ago

Roadmap:

  1. User clicks "Subscribe to wind speed notifications", they submit their phone number, and we store it in a (postgres?) database.
  2. We poll forecast.io for the wind speed every N minutes. If the wind speed exceeds the threshold, we blast everyone on the mailing list.

One thing we may need to worry about down the road is gusty weather causing residents to receive a barrage of notifications as the wind exceeds dangerous levels, subsides, and then picks up again. I can imagine that this would be really annoying for subscribers.

benwilhelm commented 9 years ago

This roadmap looks good. Fleshing it out a little bit after having discussed some infrastructure options with Christopher:

  1. We can store user info in WuFoo, rather than our own database, which will allow Olga to access the data for her own publicity and organizing purposes without our having to build out a GUI for it. WuFoo has an API that we can use to pull the phone numbers out when we want to send an alert and to handle subscribe/unsubcribe requests.
  2. I was thinking we'd set a limit of no more than once every 12 hours for the broadcasting alerts, to avoid the situation you describe where users receive repeated alerts on gusty days. We're already using memcached to cache forecast.io results so that we don't poll their API more than once every 5 minutes. We could easily use it to store a "lastAlerted" timestamp.
justinmanley commented 9 years ago

Merged in to the feature/sms branch.