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