summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 099767c..7185672 100644
--- a/main.go
+++ b/main.go
@@ -62,6 +62,7 @@ func renderPage(w http.ResponseWriter, page string, data interface{}) {
func home(w http.ResponseWriter, r *http.Request) {
renderPage(w, "home", nil)
+ go track("home", r.Header.Get("X-Forwarded-For"), "", "", "")
}
func playlist(w http.ResponseWriter, r *http.Request) {
@@ -81,6 +82,7 @@ func playlist(w http.ResponseWriter, r *http.Request) {
p := Playlist{Id: id}
renderPage(w, "p", p)
+ go track("p", r.Header.Get("X-Forwarded-For"), id, "", "")
}
func add(w http.ResponseWriter, r *http.Request) {
@@ -124,6 +126,7 @@ func add(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("1"))
addUpdate(pid, addAction,
&Song{Yid: q.Get("yid"), Title: q.Get("title"), User: q.Get("user")})
+ go track("add", r.Header.Get("X-Forwarded-For"), q.Get("pid"), q.Get("title"), q.Get("user"))
}
func remove(w http.ResponseWriter, r *http.Request) {
@@ -176,6 +179,7 @@ func remove(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("1"))
addUpdate(pid, removeAction, &Song{Yid: q.Get("yid")})
+ go track("remove", r.Header.Get("X-Forwarded-For"), q.Get("pid"), "", "")
}
func move(w http.ResponseWriter, r *http.Request) {
@@ -335,4 +339,5 @@ func create(w http.ResponseWriter, r *http.Request) {
return
}
http.Redirect(w, r, "/p/" + idStr, http.StatusSeeOther)
+ go track("create",r.Header.Get("X-Forwarded-For"), idStr, "", "")
}