From c439b61c17075ad27035ffee85621fa67e8e3e95 Mon Sep 17 00:00:00 2001 From: star-nox Date: Thu, 14 Mar 2024 12:22:05 -0500 Subject: [PATCH] moved dummy elsevier api key to env --- ai_ta_backend/journal_ingest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ai_ta_backend/journal_ingest.py b/ai_ta_backend/journal_ingest.py index 2037f279..1c84149f 100644 --- a/ai_ta_backend/journal_ingest.py +++ b/ai_ta_backend/journal_ingest.py @@ -20,6 +20,7 @@ # Below functions hit API endpoints from sites like arXiv, Elsevier, and Sringer Nature to retrieve journal articles SPRINGER_API_KEY = os.environ.get('SPRINGER_API_KEY') ELSEVIER_API_KEY = os.environ.get('ELSEVIER_API_KEY') +ELSEVIER_TEST_API_KEY = os.environ.get('ELSEVIER_TEST_API_KEY') SUPABASE_CLIENT = supabase.create_client( # type: ignore supabase_url=os.getenv('SUPABASE_URL'), # type: ignore @@ -478,7 +479,7 @@ def searchScienceDirectArticles(course_name: str, search_str: str, article_title url = "https://api.elsevier.com/content/search/sciencedirect" #headers = {'X-ELS-APIKey': ELSEVIER_API_KEY, 'Accept':'application/json'} - headers = {'X-ELS-APIKey': "7f59af901d2d86f78a1fd60c1bf9426a", 'Accept':'application/json'} + headers = {'X-ELS-APIKey': ELSEVIER_TEST_API_KEY, 'Accept':'application/json'} response = requests.put(url, headers=headers, json=data) if response.status_code != 200: