
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@mediocre/referer-parser
Advanced tools
library for extracting marketing attribution data (such as search terms) from referrer URLs
This is the node.js (JavaScript) implementation of referer-parser referer-parser, the library for extracting search marketing data from referer (sic) URLs.
The implementation uses the shared 'database' of known referers found in [referers.yml
] referers-yml
The Javascript version of referer-parser is maintained by [Martin Katrenik] mkatrenik.
$ npm install referer-parser
Create a new instance of a Referer object by passing in the url you want to parse:
var Referer = require('referer-parser')
referer_url = 'http://www.google.com/search?q=gateway+oracle+cards+denise+linn&hl=en&client=safari'
var r = new Referer(referer_url)
The r
variable now holds a Referer instance. The important attributes are:
console.log(r.known) // true
console.log(r.referer) // 'Google'
console.log(r.medium) // 'search'
console.log(r.search_parameter) // 'q'
console.log(r.search_term) // 'gateway oracle cards denise linn'
console.log(r.uri) // result of require('url').parse(...)
Optionally, pass in the current URL as well, to handle internal referers
var Referer = require('referer-parser')
var referer_url = 'http://www.snowplowanalytics.com/about/team'
var current_url = 'http://www.snowplowanalytics.com/account/profile'
var r = Referer(referer_url, current_url)
The attributes would be
console.log(r.known) // true
console.log(r.referer) // null
console.log(r.medium) // 'internal'
console.log(r.search_parameter) // null
console.log(r.search_term) // null
console.log(r.uri) // result of require('url').parse(...)
The referer-parser node.js (JavaScript) library is copyright 2013 Martin Katrenik.
Licensed under the [Apache License, Version 2.0] license (the "License"); you may not use this software except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
library for extracting marketing attribution data (such as search terms) from referrer URLs
The npm package @mediocre/referer-parser receives a total of 134 weekly downloads. As such, @mediocre/referer-parser popularity was classified as not popular.
We found that @mediocre/referer-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.