Skip to content

Instantly share code, notes, and snippets.

@g2p
Forked from hennzen/export-shazam-web.js
Last active January 21, 2023 14:41
Show Gist options
  • Select an option

  • Save g2p/1e45df5c70a22e2c01edc91978d56896 to your computer and use it in GitHub Desktop.

Select an option

Save g2p/1e45df5c70a22e2c01edc91978d56896 to your computer and use it in GitHub Desktop.
Export Shazam list to JSON format
// JS-Console script to export song name, artist and cover image URL to a JSON format
// Order of results is in ascending date order. If you want to change that, delete line with '.reverse()'
// The result is copied to your clipboard
//
// 1. Open https://www.shazam.com/myshazam and login
// 2. Scroll down to the end of your list, so that *all* songs are loaded
// 3. Open Developer console with F12
// 4. Copy paste this code to the JS-console and hit Enter
// 5. Paste the result to your favorite text editor. Voilà.
// Output JSON looks like
// [
// {
// "no": 1,
// "title": "Dancing With The Damned",
// "artist": "Killing Mood",
// "cover": "https://images.shazam.com/coverart/t50270807-b333557118_s400.jpg"
// }
// ]
copy(
$$('ul.panel-bd.panel-bd-wide')
.reverse() // delete this line for date descending order
.map((item, index) => ({
no: index+1,
title: item.querySelector('.title').innerText,
artist: item.querySelector('.artist').innerText,
cover: item.querySelector('.image.album-art').style['background-image'].match(/"(.*?)"/)[1]
}))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment