Skip to content

Instantly share code, notes, and snippets.

@Senci
Last active June 1, 2023 10:43
Show Gist options
  • Save Senci/f1bef044f12ee9212511b53ab7420e30 to your computer and use it in GitHub Desktop.
Save Senci/f1bef044f12ee9212511b53ab7420e30 to your computer and use it in GitHub Desktop.
exports playlist to text format, when run on beatport playlist sites
// exports playlist to text format, when run on beatport playlist sites
let playlist = ''
document.querySelectorAll('li.track').forEach(li => {
let title = li.querySelector('.buk-track-primary-title').textContent.replace(/\s+/g, ' ').trim()
let mix = li.querySelector('.buk-track-remixed').textContent.replace(/\s+/g, ' ').trim()
let artist = li.querySelector('.buk-track-artists').textContent.replace(/\s+/g, ' ').trim()
if (mix === 'Original Mix') {
playlist += `${artist} - ${title}\n`
} else {
playlist += `${artist} - ${title} (${mix})\n`
}
})
console.log(playlist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment