-
-
Save sritchie/1112505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn do-join [root] | |
(let [common ["!pub" "!datestr" "!country" "!region" "!city" "!kw" "!ref" "!url"] | |
zeroed ["?pageviews" "?landings" "?new-visits" "?return-visits" "?bounces"] | |
pv (pageviews root) | |
lnd (landings root) | |
nv (new-visits root) | |
rv (return-visits root) | |
b (bounces root)] | |
(<- [?json] | |
(pv :>> (conj common !!pvs)) | |
(lnd :>> (conj common !!lnds)) | |
(nv :>> (conj common !!nvs)) | |
(rv :>> (conj common !!rvs)) | |
(b :>> (conj common !!b)) | |
(nil->zeroify !!pvs !!lnds !!nvs !!rvs !!b :>> zeroed) | |
(write-json-map [[:psn :d :url :g_C :g_r :g_c :kw :s :pv :l :nV :rV :b]] | |
:<< (concat (butlast common) zeroed) :> ?json)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment