Compare commits

...

2 Commits

  1. 13
      main.py

@ -98,6 +98,7 @@ def broadcast_all_non_farm(target:str):
driver = webdriver.Chrome(options=options)
driver, date, message = find_non_farm(driver)
while date != target:
time.sleep(0.5)
driver.refresh()
print("Non Farm Refresh")
driver, date, message = find_non_farm(driver)
@ -116,6 +117,7 @@ def broadcast_all_cpi(target:str):
driver = webdriver.Chrome(options=options)
driver, date , message = find_cpi(driver)
while date != target:
time.sleep(0.5)
driver.refresh()
print("Cpi Refresh")
driver, date, message = find_cpi(driver)
@ -133,6 +135,7 @@ def broadcast_all_fomc(target:str,date_target:str): #date_target = "20240131a"
driver = webdriver.Chrome(options=options)
driver, date , message = find_fomc(driver,date_target)
while date != target:
time.sleep(0.5)
driver.refresh()
print("Fomc Refresh")
driver, date, message = find_fomc(driver,date_target)
@ -149,6 +152,7 @@ def broadcast_all_pce(target:str,date_target:str):
driver = webdriver.Chrome(options=options)
driver, date, message1, message2 = find_pce(driver,date_target)
while date != target:
time.sleep(0.5)
driver.refresh()
print("PCE Refresh")
driver, date, message1, message2 = find_pce(driver,date_target)
@ -167,6 +171,7 @@ def broadcast_pmi(date_target:str):
driver, date, value = find_pmi(driver, date_target)
Up_date = date_target.capitalize()
while date != Up_date:
time.sleep(0.5)
driver.refresh()
print("PMI Refresh")
driver, date, value = find_pmi(driver, date_target)
@ -227,8 +232,8 @@ def print_hello(text):
print(text)
return True
schedules = {
convert_to_utc("2024/05/22", "10:33", 5): {"function": print_hello, "args": ["May"]},
convert_to_utc("2024/05/22", "10:34", 5): {"function": print_hello, "args": ["June"]},
# convert_to_utc("2024/05/22", "17:33", 5): {"function": print_hello, "args": ["May"]},
# convert_to_utc("2024/05/22", "17:34", 5): {"function": print_hello, "args": ["June"]},
convert_to_utc("2024/06/12", "20:30", 5): {"function": wrapper_function_cpi, "args": ["MAY"]},
convert_to_utc("2024/07/11", "20:30", 5): {"function": wrapper_function_cpi, "args": ["JUNE"]},
convert_to_utc("2024/08/14", "20:30", 5): {"function": wrapper_function_cpi, "args": ["JULY"]},
@ -236,7 +241,6 @@ schedules = {
convert_to_utc("2024/10/10", "20:30", 5): {"function": wrapper_function_cpi, "args": ["SEPTEMBER"]},
convert_to_utc("2024/11/13", "21:30", 5): {"function": wrapper_function_cpi, "args": ["OCTOBER"]},
convert_to_utc("2024/12/11", "21:30", 5): {"function": wrapper_function_cpi, "args": ["NOVEMBER"]},
convert_to_utc("2024/05/31", "20:30", 5): {"function": wrapper_function_pce, "args": ["April", "april-2024"]},
convert_to_utc("2024/06/28", "20:30", 5): {"function": wrapper_function_pce, "args": ["May", "may-2024"]},
convert_to_utc("2024/07/26", "20:30", 5): {"function": wrapper_function_pce, "args": ["June", "june-2024"]},
convert_to_utc("2024/08/30", "20:30", 5): {"function": wrapper_function_pce, "args": ["July", "july-2024"]},
@ -244,6 +248,7 @@ schedules = {
convert_to_utc("2024/10/31", "20:30", 5): {"function": wrapper_function_pce, "args": ["September", "september-2024"]},
convert_to_utc("2024/11/27", "21:30", 5): {"function": wrapper_function_pce, "args": ["October", "october-2024"]},
convert_to_utc("2024/12/20", "21:30", 5): {"function": wrapper_function_pce, "args": ["November", "november-2024"]},
convert_to_utc("2024/06/05", "17:30", 5): {"function": wrapper_function_non_farm, "args": ["APRIL"]},
convert_to_utc("2024/06/07", "20:30", 5): {"function": wrapper_function_non_farm, "args": ["MAY"]},
convert_to_utc("2024/07/05", "20:30", 5): {"function": wrapper_function_non_farm, "args": ["JUNE"]},
convert_to_utc("2024/08/02", "20:30", 5): {"function": wrapper_function_non_farm, "args": ["JULY"]},
@ -256,7 +261,7 @@ schedules = {
convert_to_utc("2024/09/19", "02:00", 5): {"function": wrapper_function_fomc, "args": ["September", "20240919a"]},
convert_to_utc("2024/11/08", "02:00", 5): {"function": wrapper_function_fomc, "args": ["November", "20241108a"]},
convert_to_utc("2024/12/19", "03:00", 5): {"function": wrapper_function_fomc, "args": ["December", "20241219a"]},
convert_to_utc("2024/06/03", "21:07", 5): {"function": wrapper_function_pmi, "args": ["April"]},
convert_to_utc("2024/06/05", "17:07", 5): {"function": wrapper_function_pmi, "args": ["April"]},
}
if __name__ == "__main__":
global nonfarm_url, cpi_url, fomc_url, pce_url, options

Loading…
Cancel
Save