Skip to content

Commit

Permalink
Changed time between updates to use days
Browse files Browse the repository at this point in the history
  • Loading branch information
malnoxon committed Aug 21, 2015
1 parent bdf3188 commit c3bc02e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rsstory/index.pt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</tr>
<tr>
<td>
<b>Time Between Posts (minutes):</b>
<b>Time Between Posts (days):</b>
</td>
<td>
<form>
Expand Down
5 changes: 2 additions & 3 deletions rsstory/periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rsstory/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c3bc02e

Please sign in to comment.