Skip to content

Instantly share code, notes, and snippets.

@sorenmacbeth
Created September 30, 2011 07:00
(defn landings [root]
(let [ybtag (select-fields (ybtag-tap root) ["!psn" "!pvi" "!lo" "!ln" "!g_C" "!g_r" "!g_c" "!r" "!nv"])
landing-sq (<- [!pub !country !region !city !kw !ref !url !pv-id ?c]
(ybtag !pub !pv-id !url !ln !country !region !city !r !nv)
(not= !r nil)
(expand-fields !r :> !kw !ref)
(= !ln "true")
(= !nv "1")
(c/count ?c))]
(<- [!pub !country !region !city !kw !ref !url ?s]
(landing-sq !pub !country !region !city !kw !ref !url !pv-id ?c)
(c/sum ?c :> ?s))))
(defn landings [root]
(let [ybtag (select-fields (ybtag-tap root) ["!psn" "!pvi" "!lo" "!ln" "!g_C" "!g_r" "!g_c" "!r" "!nv"])
landing-sq (<- [!pub !country !region !city !kw !ref !url !pv-id ?c]
(ybtag !pub !pv-id !url !ln !country !region !city !r !nv)
(not= !r nil)
(expand-fields !r :> !kw !ref)
(= !ln "true")
(= !nv "0")
(c/count ?c))]
(<- [!pub !country !region !city !kw !ref !url ?s]
(landing-sq !pub !country !region !city !kw !ref !url !pv-id ?c)
(c/sum ?c :> ?s))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment