Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elixir-inspector/ref_inspector
Referer parser library
https://github.com/elixir-inspector/ref_inspector
Last synced: 8 days ago
JSON representation
Referer parser library
- Host: GitHub
- URL: https://github.com/elixir-inspector/ref_inspector
- Owner: elixir-inspector
- License: apache-2.0
- Created: 2013-12-30T16:55:59.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T14:27:08.000Z (18 days ago)
- Last Synced: 2024-10-23T11:26:40.291Z (17 days ago)
- Language: Elixir
- Size: 771 KB
- Stars: 14
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Referer parser library in Elixir. Fetching info from URLs. (Text and Numbers)
README
# RefInspector
Referer parser library.
## Package Setup
To use RefInspector with your projects, edit your `mix.exs` file and add the required dependencies:
```elixir
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`.
## Application Configuration
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`.
## Referer Database
The default database is taken from the [snowplow-referer-parser](https://github.com/snowplow-referer-parser/referer-parser) project.
## Basic Usage
### Database Download
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.
### Referer Parsing
```elixir
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](https://hexdocs.pm/ref_inspector).
## Benchmark
Several (minimal) benchmark scripts are included. Please refer to the Mixfile or `mix help` output for their names.
## Resources
- [snowplow-referer-parser](https://github.com/snowplow-referer-parser/referer-parser)
## License
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
_Referers.yml_ taken from the [snowplow-referer-parser](https://github.com/snowplow-referer-parser/referer-parser) project. See there for detailed license information about the data contained.