Skip to content

Commit

Permalink
Create main_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
DEENUU1 committed Jan 1, 2024
1 parent 177f962 commit 4428b6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 16 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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")
}
3 changes: 0 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ def run_jjit():
print("Data saved successfully")
else:
print("Could not send scraped data via API")


run_jjit()

0 comments on commit 4428b6d

Please sign in to comment.