diff --git a/main.py b/main.py new file mode 100644 index 0000000..7920ba8 --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +from tasks import run_jjit +import json + + +def main_handler(event, context): + site_id = event.get("site_id") + + if site_id == "jjit": + run_jjit() + else: + return + + return { + "statusCode": 200, + "body": json.dumps(f"Scraping for site {site_id} completed") + } diff --git a/tasks.py b/tasks.py index 7bf9210..e2cdebc 100644 --- a/tasks.py +++ b/tasks.py @@ -22,6 +22,3 @@ def run_jjit(): print("Data saved successfully") else: print("Could not send scraped data via API") - - -run_jjit()