Referer parser library.
To use RefInspector with your projects, edit your mix.exs
file and add the required dependencies:
defp deps do
[
# ...
{:ref_inspector, "~> 2.0"},
# ...
]
end
If you want to use a manual supervision approach (without starting the application) please look at the inline documentation of RefInspector.Supervisor
.
Out of the box the default database will be stored in the :priv_dir
of :ref_inspector
. Both the database(s) and path used can be changed.
For a detailed list of available configuration options please consult RefInspector.Config
.
The default database is taken from the snowplow-referer-parser project.
You need to obtain a copy of the configured database by calling either mix ref_inspector.download
from the command line or RefInspector.Downloader.download/0
from within your application.
Refer to RefInspector.Downloader
for more details.
iex> RefInspector.parse("http://www.google.com/search?q=ref_inspector")
%RefInspector.Result{
medium: "search",
referer: "http://www.google.com/search?q=ref_inspector",
source: "Google",
term: "ref_inspector"
}
Full documentation is available inline in the RefInspector
module and at https://hexdocs.pm/ref_inspector.
Several (minimal) benchmark scripts are included. Please refer to the Mixfile or mix help
output for their names.
Referers.yml taken from the snowplow-referer-parser project. See there for detailed license information about the data contained.