From c3bc02edc9c8c270b58cb55c69b67c1188f99a38 Mon Sep 17 00:00:00 2001 From: Daniel Daphron Kaczmarek Date: Fri, 21 Aug 2015 11:22:52 -0500 Subject: [PATCH] Changed time between updates to use days --- rsstory/index.pt | 2 +- rsstory/periodic.py | 5 ++--- rsstory/rss.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rsstory/index.pt b/rsstory/index.pt index 147fdd1..43c0aab 100644 --- a/rsstory/index.pt +++ b/rsstory/index.pt @@ -45,7 +45,7 @@ - Time Between Posts (minutes): + Time Between Posts (days):
diff --git a/rsstory/periodic.py b/rsstory/periodic.py index be7dae5..b7592a7 100644 --- a/rsstory/periodic.py +++ b/rsstory/periodic.py @@ -9,9 +9,8 @@ def setup_cron(fpath, time_between): tab = CronTab(user=True) cmd = os.path.join(os.getcwd(), 'venv', 'bin', 'python') + ' ' + os.path.join(os.getcwd(), 'rsstory', 'periodic.py') + ' ' + fpath cron_job = tab.new(cmd) - minutes_between = time_between.total_seconds() / 60.0 - cron_job.minute.every(minutes_between) - cron_job.comment = 'Job for {} at interval (minutes) {}'.format(fpath, minutes_between) + cron_job.day.every(time_between.days) + cron_job.comment = 'Job for {} at interval (days) {}'.format(fpath, time_between.days) tab.write() #TODO: remove the job once no longer needed diff --git a/rsstory/rss.py b/rsstory/rss.py index 3466f15..5652ddf 100644 --- a/rsstory/rss.py +++ b/rsstory/rss.py @@ -76,7 +76,7 @@ def archive_to_rss(url, time_between_posts, title, recaptcha_answer, ip): log.debug("recaptcha_answer is: {}".format(recaptcha_answer)) if captcha_response.is_valid: log.info("Captcha response verified as valid") - time_between = datetime.timedelta(minutes=int(time_between_posts)) + time_between = datetime.timedelta(days=int(time_between_posts)) rss_items = [] url_data = [] links = scrape(url)