Skip to content

Commit

Permalink
Merge pull request #6 from vivifyhealthcare/open_health_bot
Browse files Browse the repository at this point in the history
search health topic button added
  • Loading branch information
dhanunjayathota authored Feb 7, 2024
2 parents 111aa56 + 5b3f945 commit e941eca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 42 deletions.
44 changes: 3 additions & 41 deletions open_health/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion open_health/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# local

url = "http://127.0.0.1:8000/"
token = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzE0OTc3NzMwLCJpYXQiOjE3MDcyMDE3MzAsImp0aSI6IjJkYzRlY2M5Njk5ODQ4MWU4OTQwOGQ0NzFkMzQwNTc0IiwidXNlcl9pZCI6MX0.5omL_GpGdyOEgv__msl_I_EYxRLrBcSp0846D6Jv4Og"
token = "Bearer token"

0 comments on commit e941eca

Please # to comment.