<commit_before>var basicScraper = require('./basicScraperController');
var getExternalUrl = require('./urlController').getExternalUrl;
var CronJob = require('cron').CronJob;
var secret = require('../../config.js');
var db = require('../db.js');
var Sequelize = require('sequelize');
var compare = require('../imgCompare.js').compare;
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
    service: 'mailgun',
    auth: secret.auth
});


// var CronJob = require('cron').CronJob;

module.exports = {
  addCron: function(UserUrl, url) {
    var userUrl = UserUrl;

    // minutes
    // var freq = '* */' + UserUrl.frequency + ' * * * *';

    // test ever 10 seconds
    var freq = '*/10 * * * * *';

    // seconds
    // var freq = '*/' + UserUrl.frequency + ' * * * * *';
    
    var job = new CronJob({
      cronTime: freq,
      onTick: function() {
        console.log('checking', url, 'for changes');
         var oldImg = UserUrl.cropImage;
         var email = UserUrl.email;
         var website = url
         var params = {
          h: UserUrl.cropHeight,
          w: UserUrl.cropWidth,<commit_msg>[Feature] added CronJobManager to handle multiple cronjobs<commit_after>var basicScraper = require('./basicScraperController');
var getExternalUrl = require('./urlController').getExternalUrl;
var CronJob = require('cron').CronJob;
var CronJobManager = require('crontab_manager');
var secret = require('../../config.js');
var db = require('../db.js');
var Sequelize = require('sequelize');
var compare = require('../imgCompare.js').compare;
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
    service: 'mailgun',
    auth: secret.auth
});


// var CronJob = require('cron').CronJob;

module.exports = {
  addCron: function(UserUrl, url) {
    var userUrl = UserUrl;

    // minutes
    // var freq = '* */' + UserUrl.frequency + ' * * * *';

    // TEST every 10 seconds
    // var freq = '*/10 * * * * *';

    // seconds
    var freq = '*/' + UserUrl.frequency + ' * * * * *';
    
    var job = new CronJob({
      cronTime: freq,
      onTick: function() {
        console.log('checking', url, 'for changes');
         var oldImg = UserUrl.cropImage;
         var email = UserUrl.email;
         var website = url
         var params = {
          h: UserUrl.cropHeight,
          w: UserUrl.cropWidth,
{'fraction_non_alphanumeric': 0.16381111575428334, 'fraction_numerical': 0.003343083994985374, 'mean_word_length': 2.758241758241758, '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': '5508870', 'n_tokens_mistral': 774, 'n_tokens_neox': 742, 'n_words': 174}