<commit_before>class Jawbit::FitbitRack
  delegate :instrument, to: ActiveSupport::Notifications

  def initialize(subscriber_id, consumer_secret)
    @subscriber_id, @consumer_secret = subscriber_id, consumer_secret
  end

  def call(env)
    request = Rack::Request.new env

    instrument 'notification.fitbit', json: json(request)

    [204, {}, ['']]
  end

  private

  attr_reader :subscriber_id, :consumer_secret

  def json(request)
    MultiJson.load request.body.read
  rescue MultiJson::ParseError
    []
  end
end<commit_msg>Tweaking Fitbit parsing to use updates parameter.<commit_after>class Jawbit::FitbitRack
  delegate :instrument, to: ActiveSupport::Notifications

  def initialize(subscriber_id, consumer_secret)
    @subscriber_id, @consumer_secret = subscriber_id, consumer_secret
  end

  def call(env)
    request = Rack::Request.new env

    instrument 'notification.fitbit', json: json(request)

    [204, {}, ['']]
  end

  private

  attr_reader :subscriber_id, :consumer_secret

  def json(request)
    MultiJson.load request.params['updates']
  rescue MultiJson::ParseError
    []
  end
end
{'fraction_non_alphanumeric': 0.09821428571428571, 'fraction_numerical': 0.005357142857142857, 'mean_word_length': 4.577114427860696, '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': '2611737', 'n_tokens_mistral': 370, 'n_tokens_neox': 345, 'n_words': 79}