<commit_before>'use strict';

var _window = typeof unsafeWindow === 'undefined' ? window : unsafeWindow;

/*
 * Rules for identifying ads on individual domains.
 *
 * example: Example URL that should trigger, used for testing.
 * match: Returns true if the current article is sponsored.
 * getSponsor: Returns the name of the sponsor. Null if unknown.
 */
_window.AD_DETECTOR_RULES = {
  'ad-assets.nytimes.com': [
    {
      example: 'http://ad-assets.nytimes.com/paidpost/dell/will-millennials-ever-completely-shun-the-office.html',
      match: function() {
        return true;
      },
      getSponsor: function() {
        var paidElts = document.getElementsByClassName('paid-head-tag');
        if (paidElts.length < 1) {
          return null;
        }
        return paidElts[0].innerHTML.replace('PAID FOR AND POSTED BY ', '');
      },
    },
  ],
  'blogs.vancouversun.com': [
    {
      example: 'http://blogs.vancouversun.com/2014/03/12/cyberwarfare-expert-cancels-vancouver-talk-over-fear-of-revealing-critical-infrastructure-risks/',
      match: function() {
        return document.getElementsByClassName('tag-sponsored').length > 0;
      },
      getSponsor: function() {
        return null;
      }
    }
  ],
  'buzzfeed.com': [
    {
      example: 'http://www.buzzfeed.com/bravo/ways-to-up-your-online-dating-game',
      match: function() {
        var elts = document.getElementsByClassName('author_title');
        if (elts.length > 0) {
          return elts[0].innerHTML.indexOf('Brand Publisher') > -1;
        }
        return false;
      },
      getSponsor: function() {
        var elts = document.querySelectorAll('[rel="author"]');
        if (elts.length > 0) {
          return elts[0].innerHTML.trim();
        }
        return null;
      },
    },
  ],
  'businessinsider.com': [
    {
      example: 'http://www.businessinsider.com/sc/music-city-pizza-owner-keith-hayman-interview-2014-7',
      match: function() {
        return _window.location.href.indexOf('/sc/') > -1 ||
            document.getElementsByClassName('tooltip-sponsor').length > 0;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'chicagotribune.com': [
    {
      example: 'http://www.chicagotribune.com/brandpublishing/seniorhousingguide/',
      match: function() {
        return _window.location.href.indexOf('/brandpublishing/') > -1;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'deadspin.com': [
    {
      example: 'http://deadspin.com/5969545/exclusive-could-this-be-chris-pauls-secret-twin-brother',
      match: function() {
        return document.getElementsByClassName('sponsored-label').length > 0;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'denverpost.com': [
    {
      example: 'http://www.denverpost.com/energy-and-environment/sponsored?ccc=2106',
      match: function() {
        return _window.location.href.indexOf('/sponsored') > -1;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'digiday.com': [
    {
      example: 'http://digiday.com/sponsored/pulsepointbcs-84397/',
      match: function() {
        return _window.location.href.indexOf('/sponsored/') > -1;
      },
      getSponsor: function() {
        var elt = document.querySelector('[rel="author"]');
        return elt ? elt.innerHTML : null;
      }
    }
  ],
  'ew.com': [
    {
      example: 'http://www.ew.com/ew/gallery/0,,20308916_20447484_20885831,00.html',
      match: function() {
        return document.getElementsByClassName('sponsoredBy').length > 0;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'fastcompany.com': [
    {
      example: 'http://www.fastcompany.com/3002725/infographic-upss-2012-change-supply-chain-survey',
      match: function() {
        return _window.bootstrap_obj ? _window.bootstrap_obj.sponsored : false;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],<commit_msg>update digiday<commit_after>'use strict';

var _window = typeof unsafeWindow === 'undefined' ? window : unsafeWindow;

/*
 * Rules for identifying ads on individual domains.
 *
 * example: Example URL that should trigger, used for testing.
 * match: Returns true if the current article is sponsored.
 * getSponsor: Returns the name of the sponsor. Null if unknown.
 */
_window.AD_DETECTOR_RULES = {
  'ad-assets.nytimes.com': [
    {
      example: 'http://ad-assets.nytimes.com/paidpost/dell/will-millennials-ever-completely-shun-the-office.html',
      match: function() {
        return true;
      },
      getSponsor: function() {
        var paidElts = document.getElementsByClassName('paid-head-tag');
        if (paidElts.length < 1) {
          return null;
        }
        return paidElts[0].innerHTML.replace('PAID FOR AND POSTED BY ', '');
      },
    },
  ],
  'blogs.vancouversun.com': [
    {
      example: 'http://blogs.vancouversun.com/2014/03/12/cyberwarfare-expert-cancels-vancouver-talk-over-fear-of-revealing-critical-infrastructure-risks/',
      match: function() {
        return document.getElementsByClassName('tag-sponsored').length > 0;
      },
      getSponsor: function() {
        return null;
      }
    }
  ],
  'buzzfeed.com': [
    {
      example: 'http://www.buzzfeed.com/bravo/ways-to-up-your-online-dating-game',
      match: function() {
        var elts = document.getElementsByClassName('author_title');
        if (elts.length > 0) {
          return elts[0].innerHTML.indexOf('Brand Publisher') > -1;
        }
        return false;
      },
      getSponsor: function() {
        var elts = document.querySelectorAll('[rel="author"]');
        if (elts.length > 0) {
          return elts[0].innerHTML.trim();
        }
        return null;
      },
    },
  ],
  'businessinsider.com': [
    {
      example: 'http://www.businessinsider.com/sc/music-city-pizza-owner-keith-hayman-interview-2014-7',
      match: function() {
        return _window.location.href.indexOf('/sc/') > -1 ||
            document.getElementsByClassName('tooltip-sponsor').length > 0;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'chicagotribune.com': [
    {
      example: 'http://www.chicagotribune.com/brandpublishing/seniorhousingguide/',
      match: function() {
        return _window.location.href.indexOf('/brandpublishing/') > -1;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'deadspin.com': [
    {
      example: 'http://deadspin.com/5969545/exclusive-could-this-be-chris-pauls-secret-twin-brother',
      match: function() {
        return document.getElementsByClassName('sponsored-label').length > 0;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'denverpost.com': [
    {
      example: 'http://www.denverpost.com/energy-and-environment/sponsored?ccc=2106',
      match: function() {
        return _window.location.href.indexOf('/sponsored') > -1;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'digiday.com': [
    {
      example: 'http://digiday.com/sponsored/pulsepointbcs-84397/',
      match: function() {
        return _window.location.href.indexOf('/sponsored/') > -1 ||
            document.getElementsByClassName('sponsored-flag').length > 0;
      },
      getSponsor: function() {
        var elt = document.querySelector('[rel="author"]');
        return elt ? elt.innerHTML : null;
      }
    }
  ],
  'ew.com': [
    {
      example: 'http://www.ew.com/ew/gallery/0,,20308916_20447484_20885831,00.html',
      match: function() {
        return document.getElementsByClassName('sponsoredBy').length > 0;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
  'fastcompany.com': [
    {
      example: 'http://www.fastcompany.com/3002725/infographic-upss-2012-change-supply-chain-survey',
      match: function() {
        return _window.bootstrap_obj ? _window.bootstrap_obj.sponsored : false;
      },
      getSponsor: function() {
        return null;
      },
    },
  ],
{'fraction_non_alphanumeric': 0.15263996079872597, 'fraction_numerical': 0.020213156927600145, 'mean_word_length': 2.3092825293879207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, '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': '3337656', 'n_tokens_mistral': 2787, 'n_tokens_neox': 2631, 'n_words': 405}