referer-parser
Version, currently 0.1.12 versions
- 0.1.1latestJun 17, 2020
- 0.1.0not indexedAug 23, 2024
github.com/confact/referer-parser.cr
Crystal implementation of snowplow's referer-parser.
5 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
referer-parser:
github: confact/referer-parser.cr
version: ~> 0.1.1Then run:
shards installshard.yml
- Crystal
0.34.0- License
- MIT
- Author
- Håkan Nylén <hakan@dun.se>
Dependencies
This version declares no dependencies.
README
# referer-parser
An crystal implementation of [referer-parser](https://github.com/snowplow/referer-parser), an library for extracting search marketing data from referer (sic) URL.
This one is huge inspired and borrowed code from the ruby implementation: https://github.com/snowplow-referer-parser/ruby-referer-parser
This one only support YAML for now.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
referer-parser:
github: confact/referer-parser.cr
```
2. Run `shards install`
## Usage
```crystal
require "referer-parser"
```
### Use parser
create an instance of the parser:
```crystal
parser = RefererParser::Parser.new
```
And then you can start parsing the urls like this:
```crystal
parser.parse("http://www.google.com/search?q=gateway+oracle+cards+denise+linn&hl=en&client=safari")
# => {
known: true,
source: "Google",
medium: "search",
uri:
"http://www.google.com/search?q=gateway+oracle+cards+denise+linn&hl=en&client=safari",
term: "gateway oracle cards denise linn",
domain: "google.com"
}
```
## What is left
We don't support the JSON of the data file snowplow is releasing right now.
## Development
```
shards install
```
You can then add require on an test file or use the specs for test functionality.
You run the tests like this:
```
crystal spec
```
## Contributing
1. Fork it (<https://github.com/confact/referer-parser/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Håkan Nylén](https://github.com/confact) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.1- Tagged
- Jun 17, 2020
- Commit
3c88c7f97733- Crystal
0.34.0- Indexed
- yes
Dependents
Repository
github.com/confact/referer-parser.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 2