Didn't I fix this bug already? Oh well. Fixed.

Added user agent tracking for Edge and DuckDuckGo.
This commit is contained in:
Azareal 2018-01-09 10:37:14 +00:00
parent c2a3e66c6b
commit 17b21bb7da
3 changed files with 10 additions and 0 deletions

View File

@ -348,6 +348,8 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
common.AgentViewCounter.Bump(9) common.AgentViewCounter.Bump(9)
case strings.Contains(ua,"OPR"): // Pretends to be Chrome, needs to run before that case strings.Contains(ua,"OPR"): // Pretends to be Chrome, needs to run before that
common.AgentViewCounter.Bump(3) common.AgentViewCounter.Bump(3)
case strings.Contains(ua,"Edge"):
common.AgentViewCounter.Bump(5)
case strings.Contains(ua,"Chrome"): case strings.Contains(ua,"Chrome"):
common.AgentViewCounter.Bump(2) common.AgentViewCounter.Bump(2)
case strings.Contains(ua,"Firefox"): case strings.Contains(ua,"Firefox"):
@ -358,6 +360,8 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
common.AgentViewCounter.Bump(6) common.AgentViewCounter.Bump(6)
case strings.Contains(ua,"Baiduspider"): case strings.Contains(ua,"Baiduspider"):
common.AgentViewCounter.Bump(10) common.AgentViewCounter.Bump(10)
case strings.Contains(ua,"DuckDuckBot"):
common.AgentViewCounter.Bump(11)
default: default:
common.AgentViewCounter.Bump(0) common.AgentViewCounter.Bump(0)
} }

View File

@ -317,6 +317,8 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
common.AgentViewCounter.Bump({{.AllAgentMap.bing}}) common.AgentViewCounter.Bump({{.AllAgentMap.bing}})
case strings.Contains(ua,"OPR"): // Pretends to be Chrome, needs to run before that case strings.Contains(ua,"OPR"): // Pretends to be Chrome, needs to run before that
common.AgentViewCounter.Bump({{.AllAgentMap.opera}}) common.AgentViewCounter.Bump({{.AllAgentMap.opera}})
case strings.Contains(ua,"Edge"):
common.AgentViewCounter.Bump({{.AllAgentMap.edge}})
case strings.Contains(ua,"Chrome"): case strings.Contains(ua,"Chrome"):
common.AgentViewCounter.Bump({{.AllAgentMap.chrome}}) common.AgentViewCounter.Bump({{.AllAgentMap.chrome}})
case strings.Contains(ua,"Firefox"): case strings.Contains(ua,"Firefox"):
@ -327,6 +329,8 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
common.AgentViewCounter.Bump({{.AllAgentMap.internetexplorer}}) common.AgentViewCounter.Bump({{.AllAgentMap.internetexplorer}})
case strings.Contains(ua,"Baiduspider"): case strings.Contains(ua,"Baiduspider"):
common.AgentViewCounter.Bump({{.AllAgentMap.baidu}}) common.AgentViewCounter.Bump({{.AllAgentMap.baidu}})
case strings.Contains(ua,"DuckDuckBot"):
common.AgentViewCounter.Bump({{.AllAgentMap.duckduckgo}})
default: default:
common.AgentViewCounter.Bump({{.AllAgentMap.unknown}}) common.AgentViewCounter.Bump({{.AllAgentMap.unknown}})
} }

View File

@ -191,6 +191,8 @@ a {
font-weight: normal; font-weight: normal;
-webkit-margin-before: 0; -webkit-margin-before: 0;
-webkit-margin-after: 0; -webkit-margin-after: 0;
margin-block-start: 0;
margin-block-end: 0;
display: inline; display: inline;
} }
.rowsmall { .rowsmall {