diff --git a/open_health/main.py b/open_health/main.py index 339873f..c319a61 100644 --- a/open_health/main.py +++ b/open_health/main.py @@ -328,52 +328,14 @@ def diabetes_get_interaction(userid): # print(interaction_id2) return interaction_id2 # print(diabetes_get_interaction(7)) - - - - - -###################################### Search helath topic function ############################### - - -# import requests -# import webbrowser -# import json -# def get_details(query): -# Api = 'https://www.googleapis.com/customsearch/v1?key=###########################################={}'.format(query) -# print(Api) -# response = requests.get(url=Api) -# print(response) -# count=response.json()['queries']['request'][0]['count'] -# title=response.json()['items'][0]['link'] -# print(title) -# print(count) -# message="" -# if count<5: -# for i in range(count): -# link=response.json()['items'][i]['link'] -# title=response.json()['items'][i]['title'] -# link1 = link + '\n' -# message +='['+title+']'+'('+link1+')' + '\n' + '\n' -# return message - -# else: -# for i in range(5): -# link=response.json()['items'][i]['link'] -# title=response.json()['items'][i]['title'] -# link1 = link + '\n' -# message +='['+title+']'+'('+link1+')' + '\n' + '\n' -# return message - - -# # print(get_details("covid")) + import requests def get_details(query): - api_key = '##################################################' - cx = '62398b8d5473f42ae' + api_key = 'pass the your search engine api_key' + cx = 'pass the your search engine id' url = f'https://www.googleapis.com/customsearch/v1?key={api_key}&cx={cx}&q={query}' try: diff --git a/open_health/urls.py b/open_health/urls.py index e2103dc..c0674cc 100644 --- a/open_health/urls.py +++ b/open_health/urls.py @@ -2,4 +2,4 @@ # local url = "http://127.0.0.1:8000/" -token = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzE0OTc3NzMwLCJpYXQiOjE3MDcyMDE3MzAsImp0aSI6IjJkYzRlY2M5Njk5ODQ4MWU4OTQwOGQ0NzFkMzQwNTc0IiwidXNlcl9pZCI6MX0.5omL_GpGdyOEgv__msl_I_EYxRLrBcSp0846D6Jv4Og" +token = "Bearer token"