fixed referer ranking
This commit is contained in:
parent
7be6e67aaf
commit
592d93c2a9
@ -1,7 +1,4 @@
|
||||
"""Gather analytics from nginx access logs and visualize them through generated images and a generated html"""
|
||||
# __package__ = 'regina'
|
||||
|
||||
# from db_operation import database, visualize, collect
|
||||
import regina.db_operation
|
||||
import regina.utility
|
||||
print("running __init__.py")
|
||||
from regina.db_operation import database, visualize, collect
|
||||
|
@ -321,9 +321,11 @@ def cleanup_referer(referer: str) -> str:
|
||||
domain = m.groups()[1].replace(subdomains, "")
|
||||
location = m.groups()[3]
|
||||
|
||||
assert(len(domain.split(".")) == 2)
|
||||
referer = domain.split(".")[0]
|
||||
if not settings["referer_ranking_ignore_tld"]: referer += "." + domain.split(".")[1]
|
||||
if len(domain.split(".")) == 2: # if domain.tld
|
||||
referer = domain.split(".")[0]
|
||||
if not settings["referer_ranking_ignore_tld"]: referer += "." + domain.split(".")[1]
|
||||
else:
|
||||
referer = domain
|
||||
if not settings["referer_ranking_ignore_subdomain"]: referer = subdomains + referer
|
||||
if not settings["referer_ranking_ignore_subdomain"]: referer = subdomains + referer
|
||||
if not settings["referer_ranking_ignore_protocol"]: referer = protocol + "://" + referer
|
||||
|
Loading…
Reference in New Issue
Block a user