<commit_before>var opengraph = function() {
    //Constructor
};

opengraph.prototype = {
    og: require('open-graph'),
    regex: new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/),
    handle: function(from, chan, message) {
        var irc = global.irc;

        // use regex to find ids
        var results = this.regex.exec(message);
        if (results) {
            var uri = results[0].trim();

            var result = '';

            this.og(uri, function(err, meta){
                if (meta.title) {
                    result = meta.title;
                }

                if (meta.description) {
                    if (result) {
                        result += ' | ';
                    }
                    result += meta.title;
                }

                if (meta.site_name) {
                    if (meta.site_name == 'YouTube') {
                        return;
                    }
                
                    if (result) {
                        result += ' [' + meta.site_name + ']';
                    } else {
                        result += meta.site_name;
                    }
                }<commit_msg>Fixed jshint error in opengraph module<commit_after>var opengraph = function() {
    //Constructor
};

opengraph.prototype = {
    og: require('open-graph'),
    regex: new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/),
    handle: function(from, chan, message) {
        var irc = global.irc;

        // use regex to find ids
        var results = this.regex.exec(message);
        if (results) {
            var uri = results[0].trim();

            var result = '';

            this.og(uri, function(err, meta){
                if (meta.title) {
                    result = meta.title;
                }

                if (meta.description) {
                    if (result) {
                        result += ' | ';
                    }
                    result += meta.title;
                }

                if (meta.site_name) {
                    if (meta.site_name === 'YouTube') {
                        return;
                    }
                
                    if (result) {
                        result += ' [' + meta.site_name + ']';
                    } else {
                        result += meta.site_name;
                    }
                }
{'fraction_non_alphanumeric': 0.20161290322580644, 'fraction_numerical': 0.005376344086021506, 'mean_word_length': 1.03198127925117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '902212', 'n_tokens_mistral': 817, 'n_tokens_neox': 758, 'n_words': 123}