<commit_before>class Exchanges::Campbx < Exchanges::Base
  def ticker_poll(from_currency, to_currency)
    url = "http://campbx.com/api/xticker.php"
    data = JSON.parse(Faraday.get(url).body)
    attrs = {:highest_bid_usd => data["Best Bid"],
             :lowest_ask_usd => data["Best Ask"]}
  end

  def depth_poll(conn, from_currency, to_currency)
    # covers two markets, from/to and to/from
    url = "http://campbx.com/api/xdepth.php"
    JSON.parse(conn.get(url).body)
  end
end<commit_msg>rename slightly unusual depth keys<commit_after>class Exchanges::Campbx < Exchanges::Base
  def ticker_poll(from_currency, to_currency)
    url = "http://campbx.com/api/xticker.php"
    data = JSON.parse(Faraday.get(url).body)
    attrs = {:highest_bid_usd => data["Best Bid"],
             :lowest_ask_usd => data["Best Ask"]}
  end

  def depth_poll(conn, from_currency, to_currency)
    # covers two markets, from/to and to/from
    url = "http://campbx.com/api/xdepth.php"
    depth = JSON.parse(conn.get(url).body)
    #rename keys
    depth["asks"] = depth.delete("Asks")
    depth["bids"] = depth.delete("Bids")
    depth
  end
end
{'fraction_non_alphanumeric': 0.14586994727592267, 'fraction_numerical': 0.0, 'mean_word_length': 3.630081300813008, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7634234', 'n_tokens_mistral': 420, 'n_tokens_neox': 401, 'n_words': 77}