COVID-19 Update: Text me the latest COVID-19 stats from a location
Shrey Ravi
Posted on April 17, 2020
What I Built
In these tough times, I found myself being worried not just for my own family, but for the families of my friends all around the US. Thus, I ventured to create a Twilio-powered SMS service that returns COVID-19 stats for zip-code, state, and city, powered by my favorite thing ever, Flask (minimalist engineer's dream) at +1(231) 774-2545. Coded for the Twilio Hackathon.
Screenshots of the COVID-19 SMS Update Service in action.
Usage/Live Demo at +1(231) 774-2545!
The COVID-19 SMS Update Service can be used by texting +1(231) 774-2545 with a zip-code, a City, State Code (such as Chicago, IL), or a state (such as IL or Ohio) to get the latest COVID-19 updates for that area. One can call +1(231) 774-2545 to get these instructions read out loud.
Link to Code
Examples
Text +1(231) 774-2545 a zip-code
Input:
77001
Output:
04/13 COVID-19 SMS Update:
Harris County, Texas:
Confirmed Cases: 3629
Deaths: 44
Source: New York Times. Thanks for using COVID-19 SMS Update!
Text +1(231) 774-2545 a City, State Code
Input:
Kansas City, MO
Output:
04/13 COVID-19 SMS Update for Kansas City, MO:
Platte County, Missouri:
Confirmed Cases: 25
Deaths: 0
Jackson County, Missouri:
Confirmed Cases: 213
Deaths: 7
Clay County, Missouri:
Confirmed Cases: 48
Deaths: 1
Source: New York Times. Thanks for using COVID-19 SMS Update!
Text +1(231) 774-2545 a State
Input:
WA
Output:
04/13 COVID-19 SMS Update for Washington:
Confirmed Cases: 10411
Deaths: 511
Source: New York Times. Thanks for using COVID-19 SMS Update!
Call +1(231) 774-2545
See for yourself!
Live Homepage
The SMS and voice routes are hosted on the Heroku repo above.
Local Setup
- Clone Repository
git clone https://github.com/ShreyRavi/covid-19-sms.git
- PIP install requirements
pip install -r requirements.txt
- Run Flask app and open browser to
http://localhost:5000/
python3 app.py
- Use
ngrok
to expose yourhttp://localhost:5000/
online.
./ngrok 5000
- Configure your Twilio web-hook fields for 'Messaging' and 'Voice' to the
ngrok
generated site on your Twilio dashboard.
How I Built It
I'm not very adept at Twilio nor programming in general (pretty much only coded for school stuff so far!), but I decided to spend some time learning how to during this quarantine :) I learned from the excellent documentation at Twilio's website on how to set up Flask and ngrok
to test SMS inputs, and then it was a simple program to convert requests to zip-codes to parsing online CSVs using pandas to end up here :) It may not be much, but I learned a lot and plan to improve on it much further!
Built With
Data Source/Attribution
The COVID-19 data is sourced from the New York Times's public GitHub repository CSV of COVID-19 data, from here.
Future Plans
- More intelligent request handling
- Efficiency improvements
- Multiple data sources
- More granular reports
- Regular subscription to reports
Posted on April 17, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
October 11, 2020