Skip to content

Instantly share code, notes, and snippets.

@admariner
Forked from johnmurch/keywordsFromUrl.js
Created July 25, 2020 20:58
Show Gist options
  • Save admariner/ae103a8b8cee45033b67ec11dbd3dca5 to your computer and use it in GitHub Desktop.
Save admariner/ae103a8b8cee45033b67ec11dbd3dca5 to your computer and use it in GitHub Desktop.
Parse keywords from URL
let url = "https://www.amazon.com/SanDisk-128GB-microSDXC-Memory-Adapter/dp/B073JYC4XM/";
let kwparse = (url.replace('https://','').replace('http://','').replace('www','').replace('com','').split('-').join().split('/').join().split('.')).join(',').replace(/^,/, '')
let kwuniq = [...new Set(kwparse.split(','))].filter(function(e){return e});
console.log(kwuniq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment