<commit_before>/* social media library */
var rpssocial = {
    /* store load configuration for each social site's api */
    'apiconfig': [],
    /* set analtyics engine for social tracking */
    'analytics': 'o',
    /* set analytics for tracking, o for omniture and b for bango */
    'setanalytics': function (a_id) {
        rpssocial.analytics = a_id;
    },
    /* adds tracking param to manual links */
    'addurlparam': function (url, param, value) {
        var qstring = /\?.+$/;
        if (qstring.test(url)) {
            return url + '&' + param + '=' + value;
        }
        else {
            return url + '?' + param + '=' + value;
        }
    },
    'defaulurlparam': function (url) {
        url = rpssocial.addurlparam(url, 'utm_campaign', 'general');
        url = rpssocial.addurlparam(url, 'utm_source', 'site');
        return url;
    },
    /* supported social site configurations */
    'sites': {
        'facebook': {
            'buildurl': function (t_obj) {
                var url = rpssocial.defaulurlparam(t_obj.url);
                url = rpssocial.addurlparam(url, 'utm_medium', 'facebook');
                return 'http://www.facebook.com/share.php?u=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 550, 'popheight': 420, 'popscroll': 'no',
            'loadapi': function (cb) {
                /* call to load api */
                (function (d, debug) {
                    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
                    if (d.getElementById(id)) {
                        return;
                    }
                    js = d.createElement('script');
                    js.id = id;
                    js.async = true;
                    js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js";
                    ref.parentNode.insertBefore(js, ref);
                }(document, /*debug*/ false));
                window.fbAsyncInit = function () {
                    FB.init({
                        appId: '1509711475952744',
                        xfbml: true,
                        version: 'v2.1'
                    });
                };
            }
        },
        'twitter': {
            'buildurl': function (t_obj) {
                var url = rpssocial.defaulurlparam(t_obj.url);
                url = rpssocial.addurlparam(url, 'utm_medium', 'twitter');
                return 'http://twitter.com/intent/tweet?url=' + encodeURIComponent(url) + '&text=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 550, 'popheight': 460, 'popscroll': 'no',
            'loadapi': function (cb) {

                /* call to load api */
                window.twttr = (function (d, s, id) {
                    var t, js, fjs = d.getElementsByTagName(s)[0];
                    if (d.getElementById(id)) return;
                    js = d.createElement(s);
                    js.id = id;
                    js.src = "//platform.twitter.com/widgets.js";
                    fjs.parentNode.insertBefore(js, fjs);
                    return window.twttr || (t = {
                        _e: [], ready: function (f) {
                            t._e.push(f)
                        }
                    });
                }(document, "script", "twitter-wjs"));
                window.twttr.ready(function (twttr) {
                    twttr.events.bind('click', function (event) {
                        window.rpssocial.share.track({'type': 'click', 'site': 'twitter'});
                    });
                    if (typeof cb === 'function') {
                        cb.apply();
                    }
                });
            }
        },
        'googleplus': {
            'buildurl': function (t_obj) {
                var url = rpssocial.defaulurlparam(t_obj.url);
                url = rpssocial.addurlparam(url, 'utm_medium', 'googleplus');
                return 'https://plus.google.com/share?url=' + encodeURIComponent(url) + '&hl=en';
            },
            'popwidth': 600, 'popheight': 600, 'popscroll': 'yes',
            'loadapi': function (cb) {
                jQuery.getScript("https://apis.google.com/js/plusone.js", function success() {
                    if (typeof cb === 'function') {
                        cb.apply();
                    }
                });
            }
        },
        'linkedin': {
            'buildurl': function (t_obj) {
                return 'http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'share_linkedin')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 550, 'popheight': 570, 'popscroll': 'no',
            'loadapi': function (cb) {
                jQuery.getScript("http://platform.linkedin.com/in.js", function success() {
                    if (typeof cb === 'function') {
                        cb.apply();
                    }
                });
            }
        },
        'email': {
            'buildurl': function (t_obj) {
                return 'mailto:?subject=[Raritan Photographic Society] ' + t_obj.title + '&body=' + t_obj.title + ': ' + rpssocial.addurlparam(t_obj.url, 'sr', 'email');
            },
            'popwidth': 1, 'popheight': 1, 'popscroll': 'no'
        },
        'digg': {
            'buildurl': function (t_obj) {
                return 'http://www.digg.com/submit?phase=2&url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'digg')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 970, 'popheight': 500, 'popscroll': 'yes'
        },
        'stumbleupon': {
            'buildurl': function (t_obj) {
                return 'http://www.stumbleupon.com/submit?url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'stumbleupon')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 750, 'popheight': 500, 'popscroll': 'yes'
        },
        'delicious': {
            'buildurl': function (t_obj) {
                return 'http://del.icio.us/post?url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'delicious')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 750, 'popheight': 500, 'popscroll': 'yes'
        },
        'technorati': {
            'buildurl': function (t_obj) {<commit_msg>Add optional buffer sharing option<commit_after>/* social media library */
var rpssocial = {
    /* store load configuration for each social site's api */
    'apiconfig': [],
    /* set analtyics engine for social tracking */
    'analytics': 'o',
    /* set analytics for tracking, o for omniture and b for bango */
    'setanalytics': function (a_id) {
        rpssocial.analytics = a_id;
    },
    /* adds tracking param to manual links */
    'addurlparam': function (url, param, value) {
        var qstring = /\?.+$/;
        if (qstring.test(url)) {
            return url + '&' + param + '=' + value;
        }
        else {
            return url + '?' + param + '=' + value;
        }
    },
    'defaulurlparam': function (url) {
        url = rpssocial.addurlparam(url, 'utm_campaign', 'general');
        url = rpssocial.addurlparam(url, 'utm_source', 'site');
        return url;
    },
    /* supported social site configurations */
    'sites': {
        'facebook': {
            'buildurl': function (t_obj) {
                var url = rpssocial.defaulurlparam(t_obj.url);
                url = rpssocial.addurlparam(url, 'utm_medium', 'facebook');
                return 'http://www.facebook.com/share.php?u=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 550, 'popheight': 420, 'popscroll': 'no',
            'loadapi': function (cb) {
                /* call to load api */
                (function (d, debug) {
                    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
                    if (d.getElementById(id)) {
                        return;
                    }
                    js = d.createElement('script');
                    js.id = id;
                    js.async = true;
                    js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js";
                    ref.parentNode.insertBefore(js, ref);
                }(document, /*debug*/ false));
                window.fbAsyncInit = function () {
                    FB.init({
                        appId: '1509711475952744',
                        xfbml: true,
                        version: 'v2.1'
                    });
                };
            }
        },
        'twitter': {
            'buildurl': function (t_obj) {
                var url = rpssocial.defaulurlparam(t_obj.url);
                url = rpssocial.addurlparam(url, 'utm_medium', 'twitter');
                return 'http://twitter.com/intent/tweet?url=' + encodeURIComponent(url) + '&text=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 550, 'popheight': 460, 'popscroll': 'no',
            'loadapi': function (cb) {

                /* call to load api */
                window.twttr = (function (d, s, id) {
                    var t, js, fjs = d.getElementsByTagName(s)[0];
                    if (d.getElementById(id)) return;
                    js = d.createElement(s);
                    js.id = id;
                    js.src = "//platform.twitter.com/widgets.js";
                    fjs.parentNode.insertBefore(js, fjs);
                    return window.twttr || (t = {
                        _e: [], ready: function (f) {
                            t._e.push(f)
                        }
                    });
                }(document, "script", "twitter-wjs"));
                window.twttr.ready(function (twttr) {
                    twttr.events.bind('click', function (event) {
                        window.rpssocial.share.track({'type': 'click', 'site': 'twitter'});
                    });
                    if (typeof cb === 'function') {
                        cb.apply();
                    }
                });
            }
        },
        'googleplus': {
            'buildurl': function (t_obj) {
                var url = rpssocial.defaulurlparam(t_obj.url);
                url = rpssocial.addurlparam(url, 'utm_medium', 'googleplus');
                return 'https://plus.google.com/share?url=' + encodeURIComponent(url) + '&hl=en';
            },
            'popwidth': 600, 'popheight': 600, 'popscroll': 'yes',
            'loadapi': function (cb) {
                jQuery.getScript("https://apis.google.com/js/plusone.js", function success() {
                    if (typeof cb === 'function') {
                        cb.apply();
                    }
                });
            }
        },
        'linkedin': {
            'buildurl': function (t_obj) {
                return 'http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'share_linkedin')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 550, 'popheight': 570, 'popscroll': 'no',
            'loadapi': function (cb) {
                jQuery.getScript("http://platform.linkedin.com/in.js", function success() {
                    if (typeof cb === 'function') {
                        cb.apply();
                    }
                });
            }
        },
        'email': {
            'buildurl': function (t_obj) {
                return 'mailto:?subject=[Raritan Photographic Society] ' + t_obj.title + '&body=' + t_obj.title + ': ' + rpssocial.addurlparam(t_obj.url, 'sr', 'email');
            },
            'popwidth': 1, 'popheight': 1, 'popscroll': 'no'
        },
        'buffer': {
            'buildurl': function (t_obj) {
                return 'http://bufferapp.com/add?text=' + encodeURIComponent(t_obj.title) + '&url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'buffer'));
            },
            'popwidth': 750, 'popheight': 500, 'popscroll': 'yes'
        },
        'digg': {
            'buildurl': function (t_obj) {
                return 'http://www.digg.com/submit?phase=2&url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'digg')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 970, 'popheight': 500, 'popscroll': 'yes'
        },
        'stumbleupon': {
            'buildurl': function (t_obj) {
                return 'http://www.stumbleupon.com/submit?url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'stumbleupon')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 750, 'popheight': 500, 'popscroll': 'yes'
        },
        'delicious': {
            'buildurl': function (t_obj) {
                return 'http://del.icio.us/post?url=' + encodeURIComponent(rpssocial.addurlparam(t_obj.url, 'sr', 'delicious')) + '&title=' + encodeURIComponent(t_obj.title);
            },
            'popwidth': 750, 'popheight': 500, 'popscroll': 'yes'
        },
        'technorati': {
            'buildurl': function (t_obj) {
{'fraction_non_alphanumeric': 0.15311470500149746, 'fraction_numerical': 0.010182689427972447, 'mean_word_length': 1.518288084464555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 8, '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': '4321917', 'n_tokens_mistral': 4050, 'n_tokens_neox': 3838, 'n_words': 735}