Skip to content

Instantly share code, notes, and snippets.

@LeBaux
Forked from johnmurch/keywordsFromUrl.js
Created July 26, 2020 20:03
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 LeBaux/7e48156617beb90e47db69868519d662 to your computer and use it in GitHub Desktop.
Save LeBaux/7e48156617beb90e47db69868519d662 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