Skip to content

Instantly share code, notes, and snippets.

@BigBlueHat
Created October 17, 2022 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigBlueHat/ea55e7bf0d9d42d11d4d03c3ab36685f to your computer and use it in GitHub Desktop.
Save BigBlueHat/ea55e7bf0d9d42d11d4d03c3ab36685f to your computer and use it in GitHub Desktop.
Porkbun.com price extractor
// 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');
@BigBlueHat
Copy link
Author

Public Domain or MIT--whichever suites your scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment