DEV Community

Adarsh Menon
Adarsh Menon

Posted on • Updated on

Covid-19 Amazon Alexa Skill - Twiliohackathon

What I built

I built an Amazon Alexa skill to get information about coronavirus cases in India. You can ask it questions like

  • "How many cases are there?"
  • "What's the current status in Maharashtra?"
  • "What's the current number of cases in Uttar Pradesh?"

To get more details, you can ask

  • "Give me additional information for India"
  • "Tell me more details about Rajasthan".

Twilio API

I'm using Twilio's SMS API. Users may choose to receive an SMS containing links to resources on Covid-19 by giving the required permissions to the skill in their Alexa app settings and saying something like

  • "Send me information about coronavirus"
  • "Send me an SMS"
  • "Send additional resources to me"

Category Submission: Exciting X-Factors

Screenshots




Demo Link

You can enable this skill on your Alexa device through this beta testing link. Set the skill's language to English (US) or English (IN) according to the language to which your Alexa device is set. Please note that there is a problem in fetching phone numbers during beta testing. To test the SMS feature you'll have to build the skill yourself using the instructions given in the project's repository.

Link to Code

GitHub logo adarshme / Covid-19-India-Alexa-Skill

An Alexa Skill for information about Covid-19 in India.

Covid 19 India Alexa Skill

An Alexa Skill for information about Covid-19 in India.

About this Skill

This skill is to help you know the number of new cases, active cases and recoveries due to Covid-19 in any state/UT of the country. You may ask for a brief overview or detailed information. Choose to give phone number permissions to receive an SMS containing links to resources on Covid-19.

To get started, you can say - "Alexa, run Covid India" then try asking - "How many cases are there?" or "What's the current status in Maharashtra?" or "What's the current number of cases in Uttar Pradesh?". To get more details, you can ask "Give me additional information for India" or "Tell me more details about Rajasthan". You may also choose to receive an SMS containing links to resources on Covid-19 by giving the required permissions to the skill in your Alexa…

The Journey

For a long time I couldn't decide on what to make for the hackathon. I would get an idea, then immediately discard it thinking it was too easy/too complicated. Finally, I decided that I would make whatever I thought of next. As they say, "The hardest part is starting".

I thought of making an Alexa skill that would give users information about the coronavirus pandemic and send emails related to it. Motivated by finally deciding what to make, I set out planning to use the SendGrid API. Unfortunately, my account got blocked right after registration and so I had to drop the idea πŸ€·β€β™‚οΈ.

Even though the issue was later resolved, I didn't want to lose any momentum, so I tweaked my idea to use Twilio's SMS API. It would send users a message containing links to trusted websites (like WHO and Ministry of Health and Family Welfare) having information about the pandemic.

Getting Twilio's SMS API up and running was surprisingly easy. I was all geared up to spend countless hours trying to get it to work as I felt that sending emails/SMS through code would be an intricate process. I was pleasantly surprised to find it working in the first attempt itself! (Nothing ever works for me in the first attempt 😜)

On the flip side, using Amazon's Alexa documentation proved to be a nightmare as there was little to no documentation for Python unlike for Javascript. Trying to apply the JS docs to Python was not working. Though I felt that I made a mistake choosing Python to make the skill, I took it as a challenge. I was able to figure out stuff and in the end I was happy with the results.

I'm glad I participated in this hackathon since I learnt a lot of things I otherwise might have never learnt. The knowledge I gained through this project will surely come in handy for me.

Top comments (0)