Skip to content

Instantly share code, notes, and snippets.

@sebasjm
Last active March 7, 2018 13:12
Show Gist options
  • Save sebasjm/250314cfacffc17c2629d3a4b2b8acc7 to your computer and use it in GitHub Desktop.
Save sebasjm/250314cfacffc17c2629d3a4b2b8acc7 to your computer and use it in GitHub Desktop.
#!/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] )
{"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