 (ns pc.views.blog.common
   (:require [cheshire.core :as json]
+            [clojure.string :as str]
             [pc.views.common :refer (cdn-path)])
   (:import [java.util UUID]))
 

    (json/encode class-map) username)])

(defn dribbble-attrs [class-map prop attr & {:as extra-attrs}]
  (merge extra-attrs
         {:class (str (:class extra-attrs) " " (get class-map prop))
          :data-attr attr}))

; (defn dribbble-card [username]
;   (let [props ["comments_received_count" "bio" "shots_count" "can_upload_shot" "followings_count"

          var nodes = document.getElementsByClassName(classMap[key]);
          for (var i = 0; i < nodes.length; i++) {
            var node = nodes[i];
            var field = fields[key];
            if (subprop = node.getAttribute('data-subprop')) {
              for (k of subprop.split(',')) {
                field = field[k];
              }
            }
            node[node.getAttribute('data-attr')] = field;
          }
        }
      }
