Created
October 17, 2022 21:21
-
-
Save BigBlueHat/ea55e7bf0d9d42d11d4d03c3ab36685f to your computer and use it in GitHub Desktop.
Porkbun.com price extractor
This file contains 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
// https://porkbun.com/products/domains | |
function cleanCurrencey(n) { | |
return n.replace('$', '').replace(',', ''); | |
} | |
domains = [`TLD, Registration, Renewal, Transfer`]; | |
$('.domainsPricingAllExtensionsItem').each((i, el) => { | |
let $el = $(el); | |
domains.push(`${$el.find('a').text().trim()}, ${cleanCurrencey($el.find('.registration .sortValue').text().trim())}, ${cleanCurrencey($el.find('.renewal .sortValue').text().trim())}, ${cleanCurrencey($el.find('.transfer .sortValue').text().trim())}`); | |
}); | |
domains.join('\n'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Public Domain or MIT--whichever suites your scenario.