From 6b5f05fd0e45064f7f4c1231e635e896826d9441 Mon Sep 17 00:00:00 2001 From: fzzinchemical Date: Thu, 13 Nov 2025 22:27:49 +0100 Subject: [PATCH] Add API_SEARCH_KEY to environment variables and update main functionality to use it for searches --- .env.local | 3 ++- main.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.local b/.env.local index dcdbef9..e614553 100644 --- a/.env.local +++ b/.env.local @@ -3,4 +3,5 @@ COOKIES="" USERNAME="" PASSWORD="" EMAIL="" -EMAIL_PASSWORD="" \ No newline at end of file +EMAIL_PASSWORD="" +API_SEARCH_KEY="" \ No newline at end of file diff --git a/main.py b/main.py index a7104bd..c0ba965 100644 --- a/main.py +++ b/main.py @@ -46,6 +46,7 @@ async def main(): password = os.getenv("PASSWORD") email = os.getenv("EMAIL") email_password = os.getenv("EMAIL_PASSWORD") + api_search_key = os.getenv("API_SEARCH_KEY") await api.pool.add_account(username, password, email, email_password, cookies=cookies) await api.pool.login_all() # try to login to receive account cookies @@ -55,7 +56,7 @@ async def main(): if check_if_json_exists(OUTPUT_FILE): _results = load_json(OUTPUT_FILE).get("tweets", []) - async for rep in api.search("AI"): + async for rep in api.search(api_search_key): try: _results.append(rep.json()) logger.info("Appended tweet JSON")