Skip to content

Commit

Permalink
Add some code which hits the generator API to confirm it's working e.…
Browse files Browse the repository at this point in the history
…g. a valid project
  • Loading branch information
francisconroy committed Jun 6, 2024
1 parent 7a675d5 commit a3e7200
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ def main():
logging.basicConfig(level=logging.INFO)
log_configuration(album_config, schedule_config, ntfy_config)

# Grab the album generator API content to confirm it's a valid project
url = albumgenerator.get_project_url(album_config.project_name)
api_data = albumgenerator.get_api_json(url)
album_data = albumgenerator.extract_album_data(api_data)
message, headers = prepare_message(album_data)
logging.info(f"The last album was:\n{message}")


schedule.every().day.at(schedule_config.time, schedule_config.timezone).do(
notifcation_job,
config_path=args.config)
Expand Down

0 comments on commit a3e7200

Please sign in to comment.