Add API_SEARCH_KEY to environment variables and update main functionality to use it for searches
This commit is contained in:
@@ -3,4 +3,5 @@ COOKIES=""
|
|||||||
USERNAME=""
|
USERNAME=""
|
||||||
PASSWORD=""
|
PASSWORD=""
|
||||||
EMAIL=""
|
EMAIL=""
|
||||||
EMAIL_PASSWORD=""
|
EMAIL_PASSWORD=""
|
||||||
|
API_SEARCH_KEY=""
|
||||||
3
main.py
3
main.py
@@ -46,6 +46,7 @@ async def main():
|
|||||||
password = os.getenv("PASSWORD")
|
password = os.getenv("PASSWORD")
|
||||||
email = os.getenv("EMAIL")
|
email = os.getenv("EMAIL")
|
||||||
email_password = os.getenv("EMAIL_PASSWORD")
|
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.add_account(username, password, email, email_password, cookies=cookies)
|
||||||
await api.pool.login_all() # try to login to receive account 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):
|
if check_if_json_exists(OUTPUT_FILE):
|
||||||
_results = load_json(OUTPUT_FILE).get("tweets", [])
|
_results = load_json(OUTPUT_FILE).get("tweets", [])
|
||||||
|
|
||||||
async for rep in api.search("AI"):
|
async for rep in api.search(api_search_key):
|
||||||
try:
|
try:
|
||||||
_results.append(rep.json())
|
_results.append(rep.json())
|
||||||
logger.info("Appended tweet JSON")
|
logger.info("Appended tweet JSON")
|
||||||
|
|||||||
Reference in New Issue
Block a user