 (def stats-agent (agent 0))
 (def errors? (promise))
 (def success? (promise))
+
+(defn mappify [mymap]
+  (apply hash-map (interleave (map str (range (count mymap))) mymap)))
+
+(defn dottify-reduce [root-map str-acc]
+  (reduce-kv (fn [init k v]
+               (let [new-str-acc (if (empty? str-acc)
+                                   (name k)
+                                   (str/join "." [str-acc (name k)]))]
+                 (conj init (cond
+                              (map? v) #(dottify-reduce v new-str-acc)
+                              (vector? v) #(dottify-reduce (mappify v) new-str-acc)
+                              :else {(keyword new-str-acc) (str v)})))) [] root-map))
+
+(defn dottify
+  ([root-map] (dottify [] [#(dottify-reduce root-map "")]))
+  ([acc exec-calls]
+   (if (empty? exec-calls)
+     acc
+     (let [new-buckets (mapcat (fn [f] (f)) exec-calls)]
+       (recur (into acc (filter (complement fn?) new-buckets))
+              (filter fn? new-buckets))))))
+
 
 (defn load-config-file
   "this loads a config file from the classpath"

(ns stravinski.core
  (:require [stravinski.streamer :as streamer]
            [riemann.client :as riemann])
  (:import
   [ java.util Properties ])
  (:gen-class))

    (riemann.client/send-event @riemann-conn {:service "tweet.followers"
                                              :metric followers }))

  (let [x (apply merge (-> tweet
                           (assoc :service "tweet.full")
                           (dissoc :entities)
                           (dissoc :extended_entities)
                           dottify
                           ))
        lx (if (empty? (:geo.coordinates.0 x))
             x
             (assoc x :location (str/join "," [(:geo.coordinates.0 x) (:geo.coordinates.1 x)])))]
    (riemann.client/send-event @riemann-conn lx))
)

(defn start-feeding [f track-params]
  (let [creds-map {:app-consumer-key (assert-get "app.consumer.key")
