<commit_before>import os
import re
import pickle
from rsstory.rss import *
from crontab import CronTab


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)
    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
<commit_msg>Fixed so updates only occur at most once per day<commit_after>import os
import re
import pickle
from rsstory.rss import *
from crontab import CronTab


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)
    cron_job.every(time_between.days).dom()
    cron_job.comment = 'Job for {} at interval (days) {}'.format(fpath, time_between.days)
    tab.write()

    #TODO: remove the job once no longer needed

{'fraction_non_alphanumeric': 0.14577777777777778, 'fraction_numerical': 0.0, 'mean_word_length': 3.982300884955752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6772276', 'n_tokens_mistral': 414, 'n_tokens_neox': 403, 'n_words': 103}