<commit_before>require 'shortcodes/handler'

module Shortcodes
  class QuienManda < Handler

    def url
      shortcode.attributes.fetch('url')
    end

    def width
      attributes.fetch('width', 500)
    end

    def render
      # Get photo id to uniquely identify each embed
      url =~ /photos\/(\d+)/
      photo_id = $1

      # See http://stackoverflow.com/a/15558627
      template = <<TEMPLATE
<div id="quienmanda-embed-#{photo_id}" class="quienmanda-embed-wrapper"></div>
<script type="text/javascript" src="/javascripts/pym.min.js"></script>
<script>
    var pymParent = new pym.Parent('quienmanda-embed-#{photo_id}', '#{url}?widget=1', {});
</script>
TEMPLATE
      template
    end

    Shortcodes.register_shortcode('qm', self)
    Shortcodes.register_shortcode('quienmanda', self)
  end
end
<commit_msg>Remove comment about iframe resizing, not used anymore<commit_after>require 'shortcodes/handler'

module Shortcodes
  class QuienManda < Handler

    def url
      shortcode.attributes.fetch('url')
    end

    def width
      attributes.fetch('width', 500)
    end

    def render
      # Get photo id to uniquely identify each embed
      url =~ /photos\/(\d+)/
      photo_id = $1

      template = <<TEMPLATE
<div id="quienmanda-embed-#{photo_id}" class="quienmanda-embed-wrapper"></div>
<script type="text/javascript" src="/javascripts/pym.min.js"></script>
<script>
    var pymParent = new pym.Parent('quienmanda-embed-#{photo_id}', '#{url}?widget=1', {});
</script>
TEMPLATE
      template
    end

    Shortcodes.register_shortcode('qm', self)
    Shortcodes.register_shortcode('quienmanda', self)
  end
end

{'fraction_non_alphanumeric': 0.13788895668090298, 'fraction_numerical': 0.010982306284319707, 'mean_word_length': 3.4086021505376345, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 15, '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': '330731', 'n_tokens_mistral': 559, 'n_tokens_neox': 535, 'n_words': 117}