diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6f1c80f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv/ +*__pycache__/ \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4ccb8ac --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6a1d28a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/weatheralert.iml b/.idea/weatheralert.iml new file mode 100644 index 0000000..e942587 --- /dev/null +++ b/.idea/weatheralert.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..47da673 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,401 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + forcast_hourly_url + lat + mb-3 + 3 + + + check_in_frequency + col-mb-3 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+
+ + +
+
+ +
+ + + +
+
Previous Records
+
+
+ {{ table|safe }} +
+{% endblock %} + + +{% block javascript %} + setInterval(updateTable, {{ frequency }}) + function updateTable(){ + console.log('Making ajax call'); + console.log(" {{ url_for('get_table') }}"); + $.ajax({ + type : 'POST', + data: JSON.stringify({ + 'get' : 'get_table' + }), + contentType: 'application/json; charset=utf-8', + url : "{{url_for('get_table')}}", + success: function(res) { + $('#previous_records').empty(); + $('#previous_records').append(res); + } + + }); + } +{% endblock %} \ No newline at end of file diff --git a/app/templates/table.html b/app/templates/table.html new file mode 100644 index 0000000..c07177b --- /dev/null +++ b/app/templates/table.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + {% for rec in li %} + + + + + + + + + + + {% endfor %} + +
Time StampLatitudeLongitudeFirst ForecastFirst ForecastFirst ForecastAlert GeneratedAlert ID
{{ rec['timestamp'] }}{{rec['lat']}}{{rec['long']}}{{rec['first_forecast']}}{{rec['second_forecast']}}{{rec['third_forecast']}}{{rec['alert_generated']}}{{rec['alert_id']}}
\ No newline at end of file diff --git a/data/app.db b/data/app.db new file mode 100644 index 0000000..f2a1555 Binary files /dev/null and b/data/app.db differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..209031b --- /dev/null +++ b/main.py @@ -0,0 +1,8 @@ +from app import app + + + + +if __name__ == '__main__': + app.run() + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3045b74 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,25 @@ +APScheduler==3.9.1 +backports.zoneinfo==0.2.1 +certifi==2021.10.8 +charset-normalizer==2.0.12 +click==8.0.4 +colorama==0.4.4 +Flask==2.0.3 +Flask-SQLAlchemy==2.5.1 +greenlet==1.1.2 +idna==3.3 +importlib-metadata==4.11.2 +itsdangerous==2.1.1 +Jinja2==3.0.3 +MarkupSafe==2.1.0 +pytz==2021.3 +pytz-deprecation-shim==0.1.0.post0 +requests==2.27.1 +six==1.16.0 +SQLAlchemy==1.4.32 +typing-extensions==4.1.1 +tzdata==2021.5 +tzlocal==4.1 +urllib3==1.26.8 +Werkzeug==2.0.3 +zipp==3.7.0 diff --git a/settings.txt b/settings.txt index 1b8d204..4e25e30 100644 --- a/settings.txt +++ b/settings.txt @@ -1,7 +1,4 @@ -# Location Information -latitude = 39.7456 longitude = -97.0892 - -# Application Settings -threshold_value = 80 +latitude = 39.7456 +threshold_value = 81 check_in_frequency = 30