Piniganti Krishnavamsi
Published © GPL3+

Corona Virus Update

This project helps you to get updated about the dangerous global pandemic i. e Corona Virus. You receive statistics through api and iot.

IntermediateFull instructions provided403
Corona Virus Update

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1

Software apps and online services

https://covid19.mathdro.id/api/countries/ind
COVID-19 API
SMS Messaging API
Twilio SMS Messaging API

Story

Read more

Schematics

Message

This image shows the information that you have received through a message regarding COVID-19 Statistics in India.

Code

Configuration file,Main file

Python
The Configuration file contains all the configuration details of the Bolt wifi module and Twilio.
Note : I'm not mentioning the details because of Confidentiality.
main file:
The main file contains the code of total working.
'''Conf.py'''

SID = '******'
AUTH_TOKEN = '******'
FROM_NUMBER = '******'
TO_NUMBER = '******'
API_KEY = '*****'
DEVICE_ID = '*****'

'''main.py'''

import conf
from boltiot import Sms, Bolt
import time,json
import requests
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)
def get_stats_message():

    resp=requests.get('https://covid19.mathdro.id/api/countries/ind').json()

    return ('\nHey Krishna vamsi\nIndia Corona virus update\n'+'confirmed cases '     + str(resp['confirmed']['value'])+'\nrecovered cases '+ str(resp['recovered']     ['value'])+'\ndeaths ' +str(resp['deaths']['value'])+'\n stayhome !! stay        safe !!')



while True:
    v=get_stats_message()
    response = sms.send_sms(v)
    print("Response received from Twilio is: " + str(response))
    print("Status of SMS at Twilio is :" + str(response.status))
    time.sleep(3600)

Credits

Piniganti Krishnavamsi

Piniganti Krishnavamsi

1 project • 0 followers

Comments