Last active
July 27, 2018 00:32
-
-
Save tomprogers/aa198d44efdcf47c30a86cd948ef478d to your computer and use it in GitHub Desktop.
Script for parsing the list of favorite songs on soma.fm into TSV format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1: open somafm player | |
// Step 2: click "Favorite Songs" | |
// Step 3: drag-select all the text from the first song title to shopping cart on last row | |
// Step 4: copy & paste that text into text2tsv in JS console | |
// Step 5: paste result into Google Docs and you have a spreadsheet | |
const text2tsv = (text) => text.split('\n\n \n') | |
.map( r => r.trim().split('\n\n') ) | |
.map( t => ({ artist: String(t[0]).trim(), title: String(t[1]).trim() }) ) | |
.map( t => `${t.artist}\t${t.title}` ) | |
.join('\n') | |
copy( text2tsv(``) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment