-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ebc207
commit a13fdbf
Showing
21 changed files
with
114 additions
and
821 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
venv | ||
__pycache__ | ||
credentials/credentials.yaml | ||
credentials/receivers.txt | ||
logs/exec_timetable.json.aes | ||
.vscode |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,22 @@ | ||
# rain_alert | ||
|
||
[![App running](https://github.com/IvanVnucec/rain_alert/actions/workflows/weather_check.yml/badge.svg?branch=master&event=schedule)](https://github.com/IvanVnucec/rain_alert/actions/workflows/weather_check.yml) | ||
|
||
# rain_alert | ||
You will not forget your umbrella anymore. :umbrella: | ||
You will not forget your :umbrella: anymore. | ||
|
||
## About | ||
Check every morning at 5 AM local time if it will be raining that day, if yes | ||
send an email with forecast message like this: | ||
<html> | ||
<table> | ||
<tr> | ||
<th>Hour [h]</th> | ||
<th>Probability [%]</th> | ||
</tr> | ||
<tr> | ||
<td>6</td> | ||
<td id="CELL0">0</td> | ||
</tr> | ||
<tr> | ||
<td>7</td> | ||
<td id="CELL1">0</td> | ||
</tr> | ||
<tr> | ||
<td>8</td> | ||
<td id="CELL2">0</td> | ||
</tr> | ||
<tr> | ||
<td>9</td> | ||
<td id="CELL3">0</td> | ||
</tr> | ||
<tr> | ||
<td>10</td> | ||
<td id="CELL4">10</td> | ||
</tr> | ||
<tr> | ||
<td>11</td> | ||
<td id="CELL5">22</td> | ||
</tr> | ||
<tr> | ||
<td>12</td> | ||
<td id="CELL6">35</td> | ||
</tr> | ||
<tr> | ||
<td>13</td> | ||
<td id="CELL7">60</td> | ||
</tr> | ||
<tr> | ||
<td>14</td> | ||
<td id="CELL8">86</td> | ||
</tr> | ||
<tr> | ||
<td>15</td> | ||
<td id="CELL9">100</td> | ||
</tr> | ||
<tr> | ||
<td>16</td> | ||
<td id="CELL10">100</td> | ||
</tr> | ||
<tr> | ||
<td>17</td> | ||
<td id="CELL11">100</td> | ||
</tr> | ||
<tr> | ||
<td>18</td> | ||
<td id="CELL12">100</td> | ||
</tr> | ||
<tr> | ||
<td>19</td> | ||
<td id="CELL13">72</td> | ||
</tr> | ||
<tr> | ||
<td>20</td> | ||
<td id="CELL14">36</td> | ||
</tr> | ||
<tr> | ||
<td>21</td> | ||
<td id="CELL15">5</td> | ||
</tr> | ||
<tr> | ||
<td>22</td> | ||
<td id="CELL16">0</td> | ||
</tr> | ||
<tr> | ||
<td>23</td> | ||
<td id="CELL17">0</td> | ||
</tr> | ||
</table> | ||
</html> | ||
|
||
Check the weather at 5AM Zagreb time and send an email if it will rain today. | ||
|
||
## Get started | ||
0. Create Gmail account and enable the Less secure app access and also create an OpenWeather API Key. | ||
1. Create `credentials/credentials.yaml` file and put Gmail and OpenWeather credentials from step 0. | ||
``` | ||
senderEmail: <sender Gmail email> | ||
senderPassword: <Gmail email password> | ||
openWeatherApiKey: <OpenWeather API key> | ||
``` | ||
2. Create `credentials/receivers.txt` file put in email subscribers. For example: | ||
``` | ||
[email protected], Zagreb | ||
[email protected], Berlin | ||
[email protected], Milwaukee | ||
[email protected], Mobile Alabama | ||
[email protected], Nashville Tennessee | ||
[email protected], Nashville Indiana | ||
``` | ||
3. Run the app using Makefile as `make run` | ||
4. (Recommended) You can schedule the script to run on GitHub servers like we did in | ||
[our GitHub Actions CI workflow](https://github.com/IvanVnucec/rain_alert/blob/master/.github/workflows/weather_check.yml). | ||
See the [Instructions](./.github/workflows/README.md) for more info. | ||
|
||
1. Create Gmail account and enable the Less secure app access. | ||
2. Add the following environment variables to GitHub actions: | ||
- `SENDER_EMAIL` - sender Gmail email | ||
- `SENDER_PASSWORD` - Gmail email password | ||
- `RECEIVERS` - list of email addresses to send the alert to | ||
3. Run the GitHub Action workflow manually to check if everything is working. | ||
|
||
## License | ||
|
||
[MIT](LICENSE.md) |
Empty file.
Oops, something went wrong.