From ea8c9075e0c2801e6e0d5cac3b1b313483fd8245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20K=C3=A4mmerling?= Date: Sat, 26 Mar 2022 18:03:36 +0100 Subject: [PATCH] Extend search engines to cover top #5 worldwide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Superseeds https://github.com/usefathom/fathom/pull/69 as the Code in this MR is not valid Signed-off-by: Lukas Kämmerling --- pkg/aggregator/store.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/aggregator/store.go b/pkg/aggregator/store.go index 06b3a1af..939a3f3d 100644 --- a/pkg/aggregator/store.go +++ b/pkg/aggregator/store.go @@ -102,9 +102,18 @@ func (agg *Aggregator) getReferrerStats(r *results, siteID int64, t time.Time, h Group: "", } - // TODO: Abstract this so we can add more groupings if strings.Contains(hostname, "www.google.") { stats.Group = "Google" + } else if strings.Contains(stats.Hostname, "www.bing.") { + stats.Group = "Bing" + } else if strings.Contains(stats.Hostname, "www.baidu.") { + stats.Group = "Baidu" + } else if strings.Contains(stats.Hostname, "www.yandex.") { + stats.Group = "Yandex" + } else if strings.Contains(stats.Hostname, "search.yahoo.") { + stats.Group = "Yahoo!" + } else if strings.Contains(stats.Hostname, "www.findx.") { + stats.Group = "Findx" } }