Sends alerts based on multiple different weather events.
- Air Quality Alerts use webservices provided by AirNow: https://docs.airnowapi.org/webservices
- Temperature Apparent uses webservices provided by Tomorrow: https://docs.tomorrow.io/reference/get-timelines
The password can be found in your password manager.
$ java -Dsmtp.password="<your gmail app password>" -Dto=<comma separated lost of email address you want the alert sent to> -jar <path to jar>/alerts-1.0.0-SNAPSHOT.jar
- Create an Automator Application to Run the Script Open Automator: You can find Automator in your Applications folder or by searching with Spotlight (Cmd + Space and type "Automator").
- Create a New Document: Select "Application" when prompted to choose a type for your new document.
- Add a "Run Shell Script" Action: In the Automator window, search for "Run Shell Script" in the Library on the left. Drag the "Run Shell Script" action to the workflow area on the right.
- Enter Your Script: In the "Run Shell Script" action, enter the script you want to execute. Make sure your script is executable and includes the correct paths if necessary.
- Save the Automator Application: Go to File > Save. Save the Automator application with a descriptive name, like "Run My Script," in a location you can easily find.
- Open the Calendar App:
- You can find it in your Applications folder or by searching with Spotlight.
- Create a New Event:
- Click the + button to create a new event or double-click on the date/time you want the script to run.
- Set the Event Time and Recurrence:
- Set the start time to when you want the script to execute.
- If you want the script to run regularly, you can set the event to repeat (e.g., daily, weekly, etc.).
- Set the Alert to Run the Automator Application:
- In the event details, click on Alert.
- Choose Custom from the dropdown menu.
- In the alert options, choose Open file from the first dropdown menu.
- In the second dropdown, choose Other and locate the Automator application you created earlier. (Look in the ~/Documents folder)
- Save the Event:
- Close the event details, and your event will now trigger the script at the scheduled time.