Comparing version 1.2.1 to 1.3.0
40
index.js
@@ -17,2 +17,3 @@ #!/usr/bin/env node | ||
const { init, lookup } = require('./locate') | ||
const { getHTML, extractCSSResources, extractScriptResources, extractDomainNamesFromURLs, mergetTwoSets } = require('./resources') | ||
@@ -346,2 +347,41 @@ // validating user given torrent magnet link | ||
}) | ||
.command('lr <url> <db> [dump]', 'Locate static content delivery domain(s) used by URL', | ||
{ | ||
url: { describe: 'inspect for finding static content delivery domain(s)', type: 'string' }, | ||
db: { describe: 'path to ip2location-db5.bin', type: 'string' }, | ||
dump: { describe: 'path to sink-file.json', type: 'string', default: 'dump.json' } | ||
}, argv => { | ||
checkDB5Existance(argv.db) | ||
init(argv.db) | ||
render((map, screen) => { | ||
getHTML(argv.url).then(v => { | ||
mergetTwoSets(extractDomainNamesFromURLs(extractCSSResources(v)), | ||
extractDomainNamesFromURLs(extractScriptResources(v))).forEach(v => { | ||
domainToIP(v).then(v => { | ||
v.map(v => lookup(v)).filter(validateLookup).forEach(v => { | ||
// cached remote machine IP | ||
markers.push({ ...v, color: 'magenta', char: 'o' }) | ||
// adding remote machine's location into map | ||
addMarkerAndRender(v.lon, v.lat, 'magenta', 'o', map, screen) | ||
}) | ||
}).catch(e => { | ||
// doing nothing as of now | ||
}) | ||
}) | ||
console.log('Successful look up'.green) | ||
}).catch(_ => { | ||
screen.destroy() | ||
console.log('[!]URL lookup failed'.red) | ||
process.exit(1) | ||
}) | ||
}) | ||
}) | ||
.demandCommand().help().wrap(72).argv |
{ | ||
"name": "lenz", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Console based MAP πΊ, with lots of features packed in π", | ||
@@ -45,2 +45,3 @@ "main": "index.js", | ||
"blessed-contrib": "^4.8.20", | ||
"cheerio": "^1.0.0-rc.3", | ||
"colors": "^1.4.0", | ||
@@ -47,0 +48,0 @@ "ip2location-nodejs": "^8.3.0", |
@@ -13,2 +13,3 @@ # lenz π€ | ||
- Given torrent 𧲠link, can look up all peers associated with that infohash & show them in console map | ||
- Given one URL, parses HTML & extracts out all static content i.e. {`js`, `css`} delivery domains & geo locate them | ||
@@ -15,0 +16,0 @@ _In all these cases, generates a tabular report of all connected peers _( including self )_, who were shown on console map_ |
24051
7
525
80
10
+ Addedcheerio@^1.0.0-rc.3
+ Addedboolbase@1.0.0(transitive)
+ Addedcheerio@1.0.0(transitive)
+ Addedcheerio-select@2.1.0(transitive)
+ Addedcss-select@5.1.0(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomelementtype@2.3.0(transitive)
+ Addeddomhandler@5.0.3(transitive)
+ Addeddomutils@3.2.2(transitive)
+ Addedencoding-sniffer@0.2.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedhtmlparser2@9.1.0(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedparse5@7.2.1(transitive)
+ Addedparse5-htmlparser2-tree-adapter@7.1.0(transitive)
+ Addedparse5-parser-stream@7.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedundici@6.21.1(transitive)
+ Addedwhatwg-encoding@3.1.1(transitive)
+ Addedwhatwg-mimetype@4.0.0(transitive)