Skip to content

Instantly share code, notes, and snippets.

@sebasjm
Last active March 7, 2018 13:10
Show Gist options
  • Save sebasjm/3d38babddb168ccccfa55148535876ba to your computer and use it in GitHub Desktop.
Save sebasjm/3d38babddb168ccccfa55148535876ba to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
require('https').get(`https://crt.sh/?q=%.${procces.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": "./ctrf.js"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment