<commit_before>require 'open-uri'
require 'cgi'

class AsakusaSatellite::Filter::QuoteIt < AsakusaSatellite::Filter::Base
 def process(text, opts={})
   root = opts[:root] || 'http://quoteit.heroku.com'
   text.gsub URI.regexp(%w[http https]) do|url|
      begin
        open("#{root}/clip.html?u=#{CGI.escape url}").read
      rescue
        %[<a target="_blank" href="#{url}">#{url}</a>]
      end
    end
 end
end
<commit_msg>Use ENV['QUOTEIT_URL'] as quoteit url refs #120<commit_after>require 'open-uri'
require 'cgi'

class AsakusaSatellite::Filter::QuoteIt < AsakusaSatellite::Filter::Base
 def process(text, opts={})
   root = opts[:root] || ENV['QUOTEIT_URL'] || 'http://quoteit.heroku.com'
   text.gsub URI.regexp(%w[http https]) do|url|
      begin
        open("#{root}/clip.html?u=#{CGI.escape url}").read
      rescue
        %[<a target="_blank" href="#{url}">#{url}</a>]
      end
    end
 end
end

{'fraction_non_alphanumeric': 0.18927789934354486, 'fraction_numerical': 0.0032822757111597373, 'mean_word_length': 3.8412698412698414, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '7131864', 'n_tokens_mistral': 346, 'n_tokens_neox': 333, 'n_words': 63}