<commit_before>#!/usr/bin/ruby
require 'rubygems'
require 'hpricot'
require 'net/http'
require 'parallel'

PROCESSES = 4
PROXY     = 'proxy1.cloud.bigfish.co.uk'

class Purger
  
  def initialize(url)
    @url = url
    @uri = URI.parse(url)
    
    @urls = []
    
    # First, purge the URL itself; that means we'll get up-to-date references within that page.
    puts "Purging #{@url}...\n\n"
    purge(@url)
    
    # Then, do a fresh GET of the page and queue any resources we find on it.
    puts "Looking for external resources on #{@url}...\n\n"<commit_msg>Support the setting of Varnish's hostname via the VARNISH_PROXY_HOSTNAME environment variable.<commit_after>#!/usr/bin/ruby
require 'rubygems'
require 'hpricot'
require 'net/http'
require 'parallel'

PROCESSES = 4
if ( ENV['VARNISH_PROXY_HOSTNAME'] )
  PROXY = ENV['VARNISH_PROXY_HOSTNAME']
else
  PROXY     = 'proxy1.cloud.bigfish.co.uk'
end

class Purger
  
  def initialize(url)
    @url = url
    @uri = URI.parse(url)
    
    @urls = []
    
    # First, purge the URL itself; that means we'll get up-to-date references within that page.
    puts "Purging #{@url}...\n\n"
    purge(@url)
    
    # Then, do a fresh GET of the page and queue any resources we find on it.
    puts "Looking for external resources on #{@url}...\n\n"
{'fraction_non_alphanumeric': 0.12202609363008442, 'fraction_numerical': 0.0030698388334612432, 'mean_word_length': 2.9877675840978593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1229217', 'n_tokens_mistral': 476, 'n_tokens_neox': 464, 'n_words': 141}