RefererParser::Parser
Inherits Reference / Object
Constants
DefaultFile = File.expand_path(File.join(File.dirname("/tmp/tmp.jFpMja/src/src/referer-parser/parser.cr"), "..", "..", "data", "referers.yml"))
Constructors
new(file_path : String = DefaultFile, get_data : Bool = true)
Create a new parser from one or more filenames/uris, defaults to ../data/referers.json
Instance methods
add_referer(medium, name, domains, parameters = [""])
Add a referer to the database with medium, name, domain or array of domains, and a parameter or array of parameters If called manually and a domain is added to an existing entry with a path, you may need to call optimize_index! afterwards.
deserialize_referer_data
Sourcedomain_index
Sourcename_hash
Sourceoptimize_index!
Prune duplicate entries and sort with the most specific path first if there is more than one entry In this case, sorting by the longest string works fine