Created
July 31, 2018 09:28
-
-
Save wmh/f568b1d7154012febd0e3a150713e9a2 to your computer and use it in GitHub Desktop.
Convert cobinhood assets to SQL
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
// https://cobinhood.com/funds | |
var sql = 'INSERT INTO token_mappings (src, name, coin_name, image_url) VALUES \n'; | |
document.querySelectorAll('div.sc-AUpyg > div.sc-cSYcjD').forEach((row) => { | |
const name = row.querySelector('span.sc-gjAXCV').textContent.trim(); | |
const svg = window.btoa(new XMLSerializer().serializeToString(row.getElementsByTagName('svg')[0])); | |
const fullname = row.querySelector('span.sc-iybRtq').textContent.trim(); | |
sql += `('cobinhood', '${name}', '${fullname}', '${svg}'),\n`; | |
}); | |
console.log(sql); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment