<commit_before>module Flickrie
  class << self
    def upload_client
      @upload_client ||= new_upload_client
    end

    def new_upload_client(access_token_hash = {})
      UploadClient.new(upload_params) do |conn|
        conn.use FaradayMiddleware::OAuth,
          :consumer_key => api_key,
          :consumer_secret => shared_secret,
          :token => access_token_hash[:token] || access_token,
          :token_secret => access_token_hash[:secret] || access_secret
        conn.request :multipart

        conn.use UploadStatusCheck
        conn.use FaradayMiddleware::ParseXml<commit_msg>Add OAuthStatusCheck middleware for the upload client also<commit_after>module Flickrie
  class << self
    def upload_client
      @upload_client ||= new_upload_client
    end

    def new_upload_client(access_token_hash = {})
      UploadClient.new(upload_params) do |conn|
        conn.use FaradayMiddleware::OAuth,
          :consumer_key => api_key,
          :consumer_secret => shared_secret,
          :token => access_token_hash[:token] || access_token,
          :token_secret => access_token_hash[:secret] || access_secret
        conn.request :multipart

        conn.use UploadStatusCheck
        conn.use FaradayMiddleware::ParseXml
        conn.use OAuthStatusCheck
{'fraction_non_alphanumeric': 0.08508977361436378, 'fraction_numerical': 0.0, 'mean_word_length': 3.122186495176849, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5899985', 'n_tokens_mistral': 373, 'n_tokens_neox': 364, 'n_words': 72}