Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#Initial chatbot framework without friendly user interaction;Only direct questions and answers
import urllib
import json
import requests
"""Function to start conversation with user"""
def chatter():
x=0
print("Hi, I'm a hospital chatbot and I want to help and chat with you ! ")
print('To start a conversation with me select an option from below list:')
while(x!='/n'): #placeholder for looping
print("please select any one among the following :")
x=input('1) Accidental drug related death data \n2) Hospitals registered under Medicare \n3) Overall Covid-19 Report \n4) Country-wise Corvid-19 report\n')
if x=='1':
r= urllib.request.urlopen('http://apps.who.int/gho/athena/api/GHO/WHOSIS_000001.json#?filter=COUNTRY:BWA;YEAR:2011;SEX:BTSX')
print(r.read())
if x=='2':
r= urllib.request.urlopen('https://data.medicare.gov/api/views/84jm-wiui/rows.json')
print(r.read())
if x=='3':
r= urllib.request.urlopen('https://coronavirus-19-api.herokuapp.com/all') #from github
print(r.read())
if x=='4':
r= urllib.request.urlopen('https://coronavirus-19-api.herokuapp.com/countries') #from github
print(r.read())
if x=='exit' or x=='Exit':
return
chatter()