Unmaintained
I would recommend using the third-party-web NPM module. It's straightforward to use and easy to contribute back to.
Cheers.
Because you want to decode URLs to figure out what 3rd party they are. The data comes from the Chrome DevTools 3rd Party Badges.
const decode3P = require('third-party-decode');
const entry = decode3P('http://cdn.krxd.net');
console.log(entry.name); // 'Krux Digital, Inc.'
console.log(entry.type); // 'analytics'
$ npm install third-party-decode
null
if no third party entry found{{name: string, type: string}}
You can also run this from the command line. It will emit the JSON results to stdout.
node index.js "http://cdn.krxd.net"
# {
# "name": "Krux Digital, Inc.",
# "type": "analytics"
# }
Visit https://third-party-decode.glitch.me/ to view the results in your browser.
You can also send a request to https://third-party-decode.glitch.me/badge?url=https://cdn.krxd.net
which returns results in JSON format as follows:
{
"name": "Krux Digital, Inc.",
"type": "analytics",
"badge": "KD"
}
MIT © Paul Irish