<commit_before>;(function() {

  var config = [

    // Stream Pins
    {
      placement: 'pinterest-stream-pins',
      selector: '.Pin.Module:not(.buffer-inserted, .hideHoverUI)',
      $button: $([
        '<div class="pin-action-item Button btn">',
          '<a class="js-buffer-action pin-action position-rel" href="#" rel="buffer">',
            '<i class="icon icon-buffer"></i>',
          '</a>',
        '</div>'
      ].join('')),
      insert: function(el) {
        var $actions = $(el);
        var $newActionItem = this.$button.clone();

        $actions
          .addClass('buffer-inserted');

        $actions
          .find('.pinImageActionButtonWrapper')
          .prepend($newActionItem);

        return $newActionItem;
      },
      getData: function(el) {
        var $img = $(el).find('.pinImg');
        var image = $img.attr('src');
        // Grab text from image alt attribute
        var text = $img.attr('alt');

        var $source = $(el).find('.pinNavLink');
        if($source.length === 0){
          $source = $(el).find('.pinDomain');
        }

        var source = $source.attr('href') || $source.text();
        return {
          text: text,
          url: source,
          picture: image,
          placement: this.placement
        };
      }
    },
    // Single Pins
    {
      placement: 'pinterest-single-pin',
      selector: '.PinActionBar:not(.buffer-inserted)',
      $button: $([
        '<div class="pin-action-item action-bar Button btn">',
          '<a class="js-buffer-action pin-action position-rel" href="#" rel="buffer">',
            '<i class="icon icon-buffer"></i>',
          '</a>',
        '</div>'
      ].join('')),
      insert: function(el) {
        var $actions = $(el);
        var $newActionItem = this.$button.clone();

        $actions
          .addClass('buffer-inserted')
          .prepend($newActionItem);

        return $newActionItem;
      },
      getData: function(el) {
        var $img = $(el).parents('.closeupActionBarContainer')
                        .siblings('.closeupContainer')
                        .find('.pinImage');

        var image = $img.attr('src');
        // Grab text from image alt attribute
        var text = $img.attr('alt');

        var $source = $(el).children('.repinLike').find('.NavigateButton.website');
        var source = $source.attr('href');

        return {
          text: text,
          url: source,
          picture: image,
          placement: this.placement
        };
      }
    },
    // Pin Action Popup Pin
    {
      placement: 'pinterest-pin-popup',
      selector: '.SelectList li.item .BoardLabel:not(.buffer-inserted)',
      $button: $([
        '<div class="pin-action-item action-bar Button btn">',
          '<a class="js-buffer-action pin-action position-rel" href="#" rel="buffer">',
            '<i class="icon icon-buffer"></i>',
          '</a>',
        '</div>'
      ].join('')),
      insert: function(el) {
        var $actions = $(el);
        var $newActionItem = this.$button.clone();

        $actions
          .addClass('buffer-inserted')
          .prepend($newActionItem);

        return $newActionItem;
      },
      getData: function(el) {
        var $img = $(el).parents('.boardsWrapper').siblings('.pinContainer').find('.pinImg');

        var image = $img.attr('src');
        // Grab text from image alt attribute
        var text = $img.attr('alt');

        var $source = $(el).parents('.boardsWrapper').siblings('.pinContainer').find('.pinDomain');
        var source = $source.text();

        if(!source){
          if(window.location.search){
            var params = window.location.search.split('&');

            var urlIndex = -1;
            for(var i = 0; i < params.length; i++){
              if(params[i].indexOf('url=') > -1){
                urlIndex = i;
                break;<commit_msg>Change how Pinterest grabs the text from the Pin It action popup, so that we get the full url<commit_after>;(function() {

  var config = [

    // Stream Pins
    {
      placement: 'pinterest-stream-pins',
      selector: '.Pin.Module:not(.buffer-inserted, .hideHoverUI)',
      $button: $([
        '<div class="pin-action-item Button btn">',
          '<a class="js-buffer-action pin-action position-rel" href="#" rel="buffer">',
            '<i class="icon icon-buffer"></i>',
          '</a>',
        '</div>'
      ].join('')),
      insert: function(el) {
        var $actions = $(el);
        var $newActionItem = this.$button.clone();

        $actions
          .addClass('buffer-inserted');

        $actions
          .find('.pinImageActionButtonWrapper')
          .prepend($newActionItem);

        return $newActionItem;
      },
      getData: function(el) {
        var $img = $(el).find('.pinImg');
        var image = $img.attr('src');
        // Grab text from image alt attribute
        var text = $img.attr('alt');

        var $source = $(el).find('.pinNavLink');
        if($source.length === 0){
          $source = $(el).find('.pinDomain');
        }

        var source = $source.attr('href') || $source.text();
        return {
          text: text,
          url: source,
          picture: image,
          placement: this.placement
        };
      }
    },
    // Single Pins
    {
      placement: 'pinterest-single-pin',
      selector: '.PinActionBar:not(.buffer-inserted)',
      $button: $([
        '<div class="pin-action-item action-bar Button btn">',
          '<a class="js-buffer-action pin-action position-rel" href="#" rel="buffer">',
            '<i class="icon icon-buffer"></i>',
          '</a>',
        '</div>'
      ].join('')),
      insert: function(el) {
        var $actions = $(el);
        var $newActionItem = this.$button.clone();

        $actions
          .addClass('buffer-inserted')
          .prepend($newActionItem);

        return $newActionItem;
      },
      getData: function(el) {
        var $img = $(el).parents('.closeupActionBarContainer')
                        .siblings('.closeupContainer')
                        .find('.pinImage');

        var image = $img.attr('src');
        // Grab text from image alt attribute
        var text = $img.attr('alt');

        var $source = $(el).children('.repinLike').find('.NavigateButton.website');
        var source = $source.attr('href');

        return {
          text: text,
          url: source,
          picture: image,
          placement: this.placement
        };
      }
    },
    // Pin Action Popup Pin
    {
      placement: 'pinterest-pin-popup',
      selector: '.SelectList li.item .BoardLabel:not(.buffer-inserted)',
      $button: $([
        '<div class="pin-action-item action-bar Button btn">',
          '<a class="js-buffer-action pin-action position-rel" href="#" rel="buffer">',
            '<i class="icon icon-buffer"></i>',
          '</a>',
        '</div>'
      ].join('')),
      insert: function(el) {
        var $actions = $(el);
        var $newActionItem = this.$button.clone();

        $actions
          .addClass('buffer-inserted')
          .prepend($newActionItem);

        return $newActionItem;
      },
      getData: function(el) {
        var $img = $(el).parents('.boardsWrapper').siblings('.pinContainer').find('.pinImg');

        var image = $img.attr('src');
        // Grab text from image alt attribute
        var text = $img.attr('alt');

        // Grab full url from page behind modal
        var $source = $(document).find('img[src="'+image+'"]').parents('.pinHolder').siblings('.pinNavLink');
        var source = $source.attr('href');

        if(!source){
          if(window.location.search){
            var params = window.location.search.split('&');

            var urlIndex = -1;
            for(var i = 0; i < params.length; i++){
              if(params[i].indexOf('url=') > -1){
                urlIndex = i;
                break;
{'fraction_non_alphanumeric': 0.17431308293420722, 'fraction_numerical': 0.001008318628686665, 'mean_word_length': 1.864620938628159, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '3485006', 'n_tokens_mistral': 2288, 'n_tokens_neox': 2268, 'n_words': 490}