Rain’s Coming, Tell Your Landlord via Twilio SMS and Zillabyte
Time to read: 3 minutes
It rarely rains in San Francisco. We go months without so much as a drop, sprinkle or sun shower. But, when the rain hits, it hits hard. In December there were tremendous floods due to downpour that left homeowners and renters in dire straits. Unprepared landlords had to scramble and work against the clock to fight flooding, and repair water damage.
Nikhil Karnik, a software engineer at distributed cloud computing platform for data analysis, Zillabyte, built an app to give landlords a polite (but direct) heads up when rains are coming. Nikhil experienced flooding first hand, and hopes his new app that sends landlords rain updates via Twilio SMS can save other tenants from the hassle he suffered. Thanks to the power of Zillabyte, Nikhil knows his app can not only help out San Franciscans, but anyone in the US. Check out his blog post below, and grab the code here.
How to Build a Global Weather Alert System in Under an Hour
If the 3 day weather forecast calls for a large amount of rain, I can probably just check an app and let my landlord know in advance. But, hold on… Zillabyte is a service for distributed computing… so what’s the fun of being limited to weather data from one city? I want to help tenants notify their landlord all across America (even the whole world!) about upcoming local weather conditions. I am better served using Zillabyte to query and process data from almost every weather station in America and an automated service like Twilio to serve the notifications.
First, I wrapped all of my Twilio rest API calls inside a Zillabyte component. After registering this component, I can call this component at will. The component simply sends a message from a Twilio number about the current weather conditions in a city to a phone number subscribed to that city.
The Crux of the App
That’s seriously it. In full disclosure, this is what the entire app looks like without modularizing the Twilio Each class. All things considered, maybe 30 lines of code total. How? All because of the power of components.
Sending Twilio SMS with Zillabyte
If the 3 day weather forecast calls for a large amount of rain, I can probably just check an app and let my landlord know in advance. But, hold on… Zillabyte is a service for distributed computing… so what’s the fun of being limited to weather data from one city? I want to help tenants notify their landlord all across America (even the whole world!) about upcoming local weather conditions. I am better served using Zillabyte to query and process data from almost every weather station in America and an automated service like Twilio to serve the notifications.
First, I wrapped all of my Twilio rest API calls inside a Zillabyte component. After registering this component, I can call this component at will. The component simply sends a message from a Twilio number about the current weather conditions in a city to a phone number subscribed to that city.
Fork this component on github.
The Entire App
After registering the component, the remainder of the Zillabyte app is straightforward to write. The app uses a pre-registered component called “tomorrow_weather”, which will determine the expected forecast for tomorrow for a given city. It then sends rain notifications to phone numbers registered by city via the Twilio “send_text” component.
Why Mix Data and Notifications?
The primary utility and accessibility of “big data” stems from the ability of data systems to provide meaningful insights to humans. Certainly, many times large-scale data systems are built to feed some dynamic model on the back-end (such as an Ad model on a social network service), but under certain conditions, notifying humans is necessary. For example, if your Ad model is performing particularly poorly (users aren’t clicking because they aren’t being served relevant ads), your data science team might want to receive a text notification in case they’re out to lunch.
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.