From 944d8bc9972abd3cede92d1a30fc0a1875a439fe Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 19 Jan 2016 15:56:03 -0500 Subject: added scripts to daily for nightly cron job that creates new entry and appends weather to previous --- app/TODO | 16 ++++++++++++---- app/daily/create_daily.py | 14 ++++++++++++++ app/daily/get_weather.py | 14 ++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 app/daily/create_daily.py create mode 100644 app/daily/get_weather.py diff --git a/app/TODO b/app/TODO index 93b98c8..17f39e0 100644 --- a/app/TODO +++ b/app/TODO @@ -17,6 +17,15 @@ https://github.com/duner/django-bluebox/blob/master/bluebox/converters/sanitizer Climate classifications instead of geopolitical boundaries: https://en.wikipedia.org/wiki/Köppen_climate_classification + +shapefiles: http://koeppen-geiger.vu-wien.ac.at/shifts.htm +--- + +daily + +Still need to add widget to checkin admin to +automatically grab the geodata from device. + --- #src @@ -32,16 +41,15 @@ redirect lhp: home, book and rss # figments -iron out templates and push first piece live. +fix send to Kindle function + --- # photos: - -handle portrait orientation in resizing - finish builder +add geodata to upload port existing galleries to new structure diff --git a/app/daily/create_daily.py b/app/daily/create_daily.py new file mode 100644 index 0000000..5441b77 --- /dev/null +++ b/app/daily/create_daily.py @@ -0,0 +1,14 @@ +import sys +import os +from os.path import dirname, abspath +import django +PROJECT_ROOT = abspath(dirname(dirname(dirname(__file__)))) + '/' +sys.path.append(PROJECT_ROOT) +sys.path.append(PROJECT_ROOT + '/app') +sys.path.append(PROJECT_ROOT + '/app/lib') +sys.path.append(PROJECT_ROOT + '/config') +sys.path.append(PROJECT_ROOT + '/venv/bin/python3') +os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings' +django.setup() +from daily import retriever +retriever.create_daily() diff --git a/app/daily/get_weather.py b/app/daily/get_weather.py new file mode 100644 index 0000000..6cd56af --- /dev/null +++ b/app/daily/get_weather.py @@ -0,0 +1,14 @@ +import sys +import os +from os.path import dirname, abspath +import django +PROJECT_ROOT = abspath(dirname(dirname(dirname(__file__)))) + '/' +sys.path.append(PROJECT_ROOT) +sys.path.append(PROJECT_ROOT + '/app') +sys.path.append(PROJECT_ROOT + '/app/lib') +sys.path.append(PROJECT_ROOT + '/config') +sys.path.append(PROJECT_ROOT + '/venv/bin/python3') +os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings' +django.setup() +from daily import retriever +retriever.get_yesterday_weather() -- cgit v1.2.3