                             (t/interval (-> loc zip/node :source :ts) pub-time))]
            (conj delays (t/in-seconds post-delay)))
          delays)
+       (zip/next loc)))))
+
+
+(defn analyze-hashtags
+  "Analyze hashtag development in tree"
+  [tree]
+  (loop [hashtags []
+         loc tree]
+    (if (zip/end? loc)
+      {:source (-> (zip/root tree) :source :_id)
+       :hashtags hashtags}
+      (recur
+       (if-let [node (zip/node loc)]
+         (if-let [node-hts (get-in node [:source :hashtags])]
+           (apply conj hashtags node-hts)
+           hashtags)
+         hashtags)
        (zip/next loc)))))
 
 

(defrecord Publication [source reactions])




(defn find-reactions [pid]
  (let [reactions (mc/find-maps @db "reactions" {:source pid})]
    (Publication. pid (vec (pmap #(find-reactions (:publication %)) reactions)))))

       (sort-by second >)
       (take 50))


  (->> @full-summaries
       (pmap analyze-hashtags)
       )

  )
