<commit_before>module Burndown
  class Lighthouse
    include HTTParty
    format :xml
    
    def self.lighthouse_host
      Burndown.config[:lighthouse_host]
    end
    
    def self.default_headers(token)
      {'X-LighthouseToken' => token}
    end
    
    def self.get_token(account, token)
      get "http://#{account}.#{lighthouse_host}/tokens/#{token}.xml", :headers => default_headers(token)
    end
    
    def self.get_projects(account, token)
      get "http://#{account}.#{lighthouse_host}/projects.xml", :headers => default_headers(token)
    end
    
    def self.get_project(remote_id, account, token)
      get "http://#{account}.#{lighthouse_host}/projects/#{remote_id}.xml", :headers => default_headers(token)
    end
    
    def self.get_milestones(remote_project_id, account, token)
      get "http://#{account}.#{lighthouse_host}/projects/#{remote_project_id}/milestones.xml", :headers => default_headers(token)
    end
    
    def self.get_milestone_tickets(milestone_name, remote_project_id, account, token)
      get "http://#{account}.#{lighthouse_host}/projects/#{remote_project_id}/tickets.xml", :query => {
        :q => "milestone:'#{milestone_name}'"
      }, :headers => default_headers(token)<commit_msg>Only count open tickets, dur!<commit_after>module Burndown
  class Lighthouse
    include HTTParty
    format :xml
    
    def self.lighthouse_host
      Burndown.config[:lighthouse_host]
    end
    
    def self.default_headers(token)
      {'X-LighthouseToken' => token}
    end
    
    def self.get_token(account, token)
      get "http://#{account}.#{lighthouse_host}/tokens/#{token}.xml", :headers => default_headers(token)
    end
    
    def self.get_projects(account, token)
      get "http://#{account}.#{lighthouse_host}/projects.xml", :headers => default_headers(token)
    end
    
    def self.get_project(remote_id, account, token)
      get "http://#{account}.#{lighthouse_host}/projects/#{remote_id}.xml", :headers => default_headers(token)
    end
    
    def self.get_milestones(remote_project_id, account, token)
      get "http://#{account}.#{lighthouse_host}/projects/#{remote_project_id}/milestones.xml", :headers => default_headers(token)
    end
    
    def self.get_milestone_tickets(milestone_name, remote_project_id, account, token)
      get "http://#{account}.#{lighthouse_host}/projects/#{remote_project_id}/tickets.xml", :query => {
        :q => "milestone:\"#{milestone_name}\" state:open"
      }, :headers => default_headers(token)
{'fraction_non_alphanumeric': 0.14353876739562624, 'fraction_numerical': 0.0, 'mean_word_length': 3.676579925650558, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '5971609', 'n_tokens_mistral': 808, 'n_tokens_neox': 802, 'n_words': 130}