referer-parser
Version, currently 0.1.02 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
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
referer-parser:
github: confact/referer-parser.cr
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# 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.0- Tagged
- Aug 23, 2024
- Commit
0b2dc22fcf30- Indexed
- not yet
Dependents
Repository
github.com/confact/referer-parser.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 2