<commit_before>module Traktr
  class Comment
    include HTTParty
    base_uri File.join(Traktr.base_uri, 'comment')

    def initialize(client)
      @client = client
    end

    ##
    ## comment POST methods
    ##
    def episode( data )
      data.merge!({ username: @client.username, password: <PASSWORD>, review: data[:comment].split(/\s+/).length > 200 })
      response = self.class.post('/' + File.join('episode', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
      raise ResponseError.new(response) if response.code != 200

      Mash.new(response.parsed_response)
    end

    def movie( data )
      data.merge!({ username: @client.username, password: <PASSWORD>, review: data[:comment].split(/\s+/).length > 200 })
      response = self.class.post('/' + File.join('movie', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
      raise ResponseError.new(response) if response.code != 200

      Mash.new(response.parsed_response)
    end

    def show( data )
      data.merge!({ username: @client.username, password: <PASSWORD>, review: data[:comment].split(/\s+/).length > 200 })
      response = self.class.post('/' + File.join('show', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
      raise ResponseError.new(response) if response.code != 200

      Mash.new(response.parsed_response)
    end
  end
end<commit_msg>minor updates to comment endpoints<commit_after>module Traktr
  class Comment
    include HTTParty
    base_uri File.join(Traktr.base_uri, 'comment')

    def initialize(client)
      @client = client
      @auth = { username: @client.username, password: <PASSWORD> }
    end

    ##
    ## comment POST methods
    ##
    def episode( data )
      data.merge!(@auth.merge({ review: data[:comment].split(/\s+/).length > 200 }))
      response = self.class.post('/' + File.join('episode', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
      raise ResponseError.new(response) if response.code != 200

      Mash.new(response.parsed_response)
    end

    def movie( data )
      data.merge!(@auth.merge({ review: data[:comment].split(/\s+/).length > 200 }))
      response = self.class.post('/' + File.join('movie', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
      raise ResponseError.new(response) if response.code != 200

      Mash.new(response.parsed_response)
    end

    def show( data )
      data.merge!(@auth.merge({ review: data[:comment].split(/\s+/).length > 200 }))
      response = self.class.post('/' + File.join('show', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
      raise ResponseError.new(response) if response.code != 200

      Mash.new(response.parsed_response)
    end
  end
end
{'fraction_non_alphanumeric': 0.16095534787123572, 'fraction_numerical': 0.012461059190031152, 'mean_word_length': 3.365558912386707, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '3355019', 'n_tokens_mistral': 955, 'n_tokens_neox': 896, 'n_words': 196}