<commit_before>"use strict";

var Mail = require('./channels/Mail');
var Console = require('./channels/Console');

class SiteDownNotification {

	constructor(site)
	{
		this.site = site;

		this.message = site.getAttribute('url') + ' is down!';
	}

	toMail()
	{
		return new Mail().setBody(this.message);
	}

	toConsole()
	{
		return new Console().setBody(this.message);
	}

	via()
	{
		return ['mail', 'console'];
	}

}

module.exports = SiteDownNotification;<commit_msg>Send notification based on the sites settings<commit_after>"use strict";

var Mail = require('./channels/Mail');
var Console = require('./channels/Console');

class SiteDownNotification {

	constructor(site)
	{
		this.site = site;

		this.message = site.getAttribute('url') + ' is down!';
	}

	toMail()
	{
		return new Mail().setBody(this.message);
	}

	toConsole()
	{
		return new Console().setBody(this.message);
	}

	via()
	{
		return (this.site.notifications) ? this.site.notifications : ['console'];
	}

}

module.exports = SiteDownNotification;
{'fraction_non_alphanumeric': 0.16536203522504891, 'fraction_numerical': 0.0, 'mean_word_length': 4.166666666666667, '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': '4212678', 'n_tokens_mistral': 354, 'n_tokens_neox': 334, 'n_words': 68}