A small program to extract aurora predictions using web scraping technique with Python Selenium and report to the ntfy.sh service.
- Open https://www.gi.alaska.edu/monitors/aurora-forecast
- Click on "Next" to open current day, because by default it shows previous day at start.
- Select Europe region by clicking on the map of Europe.
- Read the KP INDEX from scale (KP INDEX: 0 1 2 3 4 5 6 7 8 9). The current value is in bold.
- If the current value is greater then or equal to threshold value (By default 5), then notify, that Aurora is visible today.
- If the value is less, then continue pressing "Next" button 7 times. In each iteration check the KP VALUE. If it's greater or equal to threshold, then notify about the predicted date and KP VALUE.
To receive reports, install Ntfy on your mobile phone and subscribe topic, which is configured on your project instance.
- Installed Google Chrome (tested on v.116.0.5845.96)
- (optional) Chrome driver https://googlechromelabs.github.io/chrome-for-testing/
- Clone git project on your server
git clone [email protected]:ATimrots/aurora_scanner.git .
(ssh example) - Install required Python packages from requirements.txt
pip install -r requirements.txt
- Configure .env variables. For
APP_ENV
use valueproduction
when you are using cron to run program in backroung. If it's set as production, then virtual display will be used instead of real Google Chrome display. You can adjustKP_INDEX_THRESHOLD
as you wish to get the best results in your region. Example, in Latvia good starting point is KP 5. If it combines with enought dark night and no clouds, then it is high possibility to catch some Aurora.NTFY_TOPIC
is used to know where to send notifications (See "Receiving forecasts" section). - Run app manually
python3 main.py
to test if no errors - Set up schedule
crontab -e
. Example, daily at 7am:
0 7 * * * /usr/bin/python3 ~/path/to/script/main.py
Example of .env
file:
APP_ENV=local
KP_INDEX_THRESHOLD=5
NTFY_TOPIC=
Take into account, if you run this project on different instances with same ntfy topic, notifications will overlay.