DEV Community

Shrey Ravi
Shrey Ravi

Posted on • Updated on

COVID-19 Update: Text me the latest COVID-19 stats from a location

See Github.

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

GitHub Repo

Examples

Text +1(231) 774-2545 a zip-code

Input:

77001
Enter fullscreen mode Exit fullscreen mode

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!
Enter fullscreen mode Exit fullscreen mode

Text +1(231) 774-2545 a City, State Code

Input:

Kansas City, MO
Enter fullscreen mode Exit fullscreen mode

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!
Enter fullscreen mode Exit fullscreen mode

Text +1(231) 774-2545 a State

Input:

WA
Enter fullscreen mode Exit fullscreen mode

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!
Enter fullscreen mode Exit fullscreen mode

Call +1(231) 774-2545

See for yourself!

Live Homepage

The SMS and voice routes are hosted on the Heroku repo above.

Local Setup

  1. Clone Repository
git clone https://github.com/ShreyRavi/covid-19-sms.git
Enter fullscreen mode Exit fullscreen mode
  1. PIP install requirements
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode
  1. Run Flask app and open browser to http://localhost:5000/
python3 app.py
Enter fullscreen mode Exit fullscreen mode
  1. Use ngrok to expose your http://localhost:5000/ online.
./ngrok 5000
Enter fullscreen mode Exit fullscreen mode
  1. 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

Top comments (2)

Collapse
 
janasunrise profile image
janaSunrise

nice, quite good use of twilio API

Collapse
 
shreyravi profile image
Shrey Ravi

Thanks so much! had a lot of fun :)