Fix More info tab formatting, add technology spend

main
Elbert Alias 4 years ago
parent cfec6af2fd
commit 8d21dbc1fc

@ -201,6 +201,34 @@ function parseEmail(fullEmail) {
return { email, name, title } return { email, name, title }
} }
function getTechnologySpend(technologies) {
const totals = technologies.reduce(
(totals, { pricing }) => {
pricing.forEach((price) => totals[price]++)
return totals
},
{ low: 0, poa: 0, mid: 0, high: 0 }
)
totals.mid += Math.floor(totals.low / 3)
totals.high += Math.floor(totals.poa / 2)
totals.high += Math.floor(totals.mid / 3)
totals.xhigh = Math.floor(totals.high / 3)
const spend = totals.xhigh
? 'Very high'
: totals.high
? 'High'
: totals.mid
? 'Medium'
: totals.low
? 'Low'
: 'Very low'
return spend
}
const Popup = { const Popup = {
/** /**
* Initialise popup * Initialise popup
@ -697,6 +725,14 @@ const Popup = {
const { attributes, creditsRemaining, crawl } = data const { attributes, creditsRemaining, crawl } = data
if (Popup.cache.detections.length) {
attributes.signals = attributes.signals || []
attributes.signals.technologySpend = getTechnologySpend(
Popup.cache.detections
)
}
el.creditsRemaining.textContent = parseInt( el.creditsRemaining.textContent = parseInt(
creditsRemaining || 0, creditsRemaining || 0,
10 10
@ -766,11 +802,20 @@ const Popup = {
a.href = value.to a.href = value.to
a.textContent = value.text a.textContent = value.text
if (['email', 'verifiedEmail', 'safeEmail'].includes(key)) { if (key === 'keywords') {
a.style = 'padding-right: .3rem;'
const space = document.createTextNode(' ')
td.append(a, space)
} else if (
['email', 'verifiedEmail', 'safeEmail'].includes(key)
) {
const { email, name, title } = parseEmail(value.text) const { email, name, title } = parseEmail(value.text)
a.textContent = email a.textContent = email
const div = document.createElement('div')
const elName = document.createElement('span') const elName = document.createElement('span')
const elTitle = document.createElement('span') const elTitle = document.createElement('span')
const elBreak1 = document.createElement('br') const elBreak1 = document.createElement('br')
@ -781,17 +826,19 @@ const Popup = {
elTitle.className = 'light-text' elTitle.className = 'light-text'
td.appendChild(a) div.append(a)
if (name) { if (name && name !== email) {
td.appendChild(elBreak1) div.appendChild(elBreak1)
td.appendChild(elName) div.appendChild(elName)
if (title) { if (title) {
td.appendChild(elBreak2) div.appendChild(elBreak2)
td.appendChild(elTitle) div.appendChild(elTitle)
} }
} }
td.append(div)
} else { } else {
div.appendChild(a) div.appendChild(a)
td.appendChild(div) td.appendChild(div)

@ -1127,7 +1127,8 @@
"driftt": "" "driftt": ""
}, },
"pricing": [ "pricing": [
"poa" "poa",
"mid"
], ],
"saas": true, "saas": true,
"website": "https://www.drift.com/" "website": "https://www.drift.com/"
@ -1338,4 +1339,4 @@
"scriptSrc": "deepMiner\\.js", "scriptSrc": "deepMiner\\.js",
"website": "https://github.com/deepwn/deepMiner" "website": "https://github.com/deepwn/deepMiner"
} }
} }

@ -817,6 +817,8 @@
"_hsq": "", "_hsq": "",
"hubspot": "" "hubspot": ""
}, },
"pricing": ["recurring", "high"],
"saas": true,
"website": "https://www.hubspot.com" "website": "https://www.hubspot.com"
}, },
"HubSpot Analytics": { "HubSpot Analytics": {
@ -1122,4 +1124,4 @@
"scriptSrc": "merchant\\.cdn\\.hoolah\\.co/", "scriptSrc": "merchant\\.cdn\\.hoolah\\.co/",
"website": "https://www.hoolah.co" "website": "https://www.hoolah.co"
} }
} }

@ -140,7 +140,7 @@ const Wappalyzer = {
.sort((a, b) => (priority(a) > priority(b) ? 1 : -1)) .sort((a, b) => (priority(a) > priority(b) ? 1 : -1))
.map( .map(
({ ({
technology: { name, slug, categories, icon, website, cpe }, technology: { name, slug, categories, icon, website, pricing, cpe },
confidence, confidence,
version, version,
lastUrl, lastUrl,
@ -152,6 +152,7 @@ const Wappalyzer = {
version, version,
icon, icon,
website, website,
pricing,
cpe, cpe,
lastUrl, lastUrl,
}) })
@ -340,6 +341,7 @@ const Wappalyzer = {
requiresCategory, requiresCategory,
icon, icon,
website, website,
pricing,
cpe, cpe,
} = data[name] } = data[name]
@ -390,6 +392,7 @@ const Wappalyzer = {
})), })),
icon: icon || 'default.svg', icon: icon || 'default.svg',
website: website || null, website: website || null,
pricing: pricing || [],
cpe: cpe || null, cpe: cpe || null,
}) })