<commit_before>class FmiJob < ActiveJob::Base
  queue_as :default

  def perform(*args)
    # fetch temeperature data from fmi and push to firebase
    data = FmiData.deliver("temperature")
    if data != "error"
      data.each { |record|
        base_uri = 'https://glowing-inferno-7580.firebaseio.com/'
        firebase = Firebase::Client.new(base_uri)
        # record = ["fmisid",
        # "latitude",
        # "longitude",
        # "mtime",
        # "temperature"]
        response = firebase.push("fmi_temp", {
                                   :g => GeoHash.encode(record[1].to_f, record[2].to_f),
                                   :l => {:'0' => record[1],
                                          :'1' => record[2]},
                                   :fmisid => record[0],
                                   :mtime => record[3],
                                   :created => Firebase::ServerValue::TIMESTAMP,
                                   :value => record[4]
                                 })
      }
    end
  end
end
<commit_msg>datatype added to hash in FmiJob<commit_after>class FmiJob < ActiveJob::Base
  queue_as :default

  def perform(*args)
    # fetch temeperature data from fmi and push to firebase
    data = FmiData.deliver("temperature")
    if data != "error"
      data.each { |record|
        base_uri = 'https://glowing-inferno-7580.firebaseio.com/'
        firebase = Firebase::Client.new(base_uri)
        # record = ["fmisid",
        # "latitude",
        # "longitude",
        # "mtime",
        # "temperature"]
        response = firebase.push("fmi_temp", {
                                   :datatype => "temperature",
                                   :g => GeoHash.encode(record[1].to_f, record[2].to_f),
                                   :l => {:'0' => record[1].to_f,
                                          :'1' => record[2].to_f},
                                   :fmisid => record[0],
                                   :mtime => record[3],
                                   :created => Firebase::ServerValue::TIMESTAMP,
                                   :value => record[4]
                                 })
      }
    end
  end
end

{'fraction_non_alphanumeric': 0.12511332728921123, 'fraction_numerical': 0.011786038077969175, 'mean_word_length': 1.207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7355395', 'n_tokens_mistral': 628, 'n_tokens_neox': 601, 'n_words': 115}