Last active
March 7, 2018 13:12
-
-
Save sebasjm/250314cfacffc17c2629d3a4b2b8acc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
require('https').get(`https://crt.sh/?q=%.${process.argv[2]}&output=json`, resp => { | |
let data = '' | |
resp.on('data', chunk => {data += chunk;}); | |
resp.on('end', () => { | |
const json = JSON.parse('['+data.split('}{').join('},{')+']'); | |
const domains = json.map( j => j.name_value ).sort().filter( (i,p,a) => !p || i != a[p-1] ) | |
domains.forEach( d => { | |
console.log(d) | |
}) | |
}) | |
}) | |
// (await fetch('https://crt.sh/?q=%.starbucks.com&output=json').then( r => r.text() ).then( t => '['+t.split('}{').join('},{')+']' ).then( t => JSON.parse(t)) ).map( j => j.name_value ).sort().filter( (i,p,a) => !p || i != a[p-1] ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name": "npx-is-cool", "version": "0.0.1", "bin": "./index.js"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment