Spaces:
Running
Running
Update mtdna_classifier.py
Browse files- mtdna_classifier.py +6 -12
mtdna_classifier.py
CHANGED
@@ -306,12 +306,9 @@ def get_country_from_text(text):
|
|
306 |
|
307 |
def search_google_custom(query, max_results=3):
|
308 |
# query should be the title from ncbi or paper/source title
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
GOOGLE_CSE_API_KEY = os.getenv("GOOGLE_CSE_API_KEY", "AIzaSyAg_Hi5DPit2bvvwCs1PpUkAPRZun7yCRQ") # account: [email protected]
|
313 |
-
GOOGLE_CSE_CX = os.getenv("GOOGLE_CSE_CX", "25a51c433f148490c")
|
314 |
-
endpoint = "https://www.googleapis.com/customsearch/v1"
|
315 |
params = {
|
316 |
"key": GOOGLE_CSE_API_KEY,
|
317 |
"cx": GOOGLE_CSE_CX,
|
@@ -336,12 +333,9 @@ def search_google_custom(query, max_results=3):
|
|
336 |
|
337 |
def search_google_custom_backup(query, max_results=3):
|
338 |
# query should be the title from ncbi or paper/source title
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
GOOGLE_CSE_API_KEY = os.getenv("GOOGLE_CSE_API_KEY", "AIzaSyBDkTo3QSAUHEPSBaWq5fX9Be4l-2EhAUM") # account: [email protected]
|
343 |
-
GOOGLE_CSE_CX = os.getenv("GOOGLE_CSE_CX", "00231c463e9464bdc")
|
344 |
-
endpoint = "https://www.googleapis.com/customsearch/v1"
|
345 |
params = {
|
346 |
"key": GOOGLE_CSE_API_KEY,
|
347 |
"cx": GOOGLE_CSE_CX,
|
|
|
306 |
|
307 |
def search_google_custom(query, max_results=3):
|
308 |
# query should be the title from ncbi or paper/source title
|
309 |
+
GOOGLE_CSE_API_KEY = os.environ["GOOGLE_CSE_API_KEY"]
|
310 |
+
GOOGLE_CSE_CX = os.environ["GOOGLE_CSE_CX"]
|
311 |
+
endpoint = os.environ["SEARCH_ENDPOINT"]
|
|
|
|
|
|
|
312 |
params = {
|
313 |
"key": GOOGLE_CSE_API_KEY,
|
314 |
"cx": GOOGLE_CSE_CX,
|
|
|
333 |
|
334 |
def search_google_custom_backup(query, max_results=3):
|
335 |
# query should be the title from ncbi or paper/source title
|
336 |
+
GOOGLE_CSE_API_KEY = os.environ["GOOGLE_CSE_API_KEY_BACKUP"]
|
337 |
+
GOOGLE_CSE_CX = os.environ["GOOGLE_CSE_CX_BACKUP"]
|
338 |
+
endpoint = os.environ["SEARCH_ENDPOINT"]
|
|
|
|
|
|
|
339 |
params = {
|
340 |
"key": GOOGLE_CSE_API_KEY,
|
341 |
"cx": GOOGLE_CSE_CX,
|