Last active
July 31, 2018 08:24
-
-
Save wmh/1fed93d0477f60e551979995a65d960a to your computer and use it in GitHub Desktop.
Convert Binance assets to SQL statment
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://www.binance.com/userCenter/balances.html | |
var sql = 'INSERT INTO token_mappings (src, name, coin_name, image_url) VALUES \n'; | |
document.querySelectorAll('ul.accountInfo-lists > li.td > div').forEach((row) => { | |
const imgURL = row.querySelector('div.coin > img').getAttribute('src'); | |
const coin = row.querySelector('div.coin').textContent.trim(); | |
const fullname = row.querySelector('div.fullName').textContent.trim(); | |
sql += `('binance', '${coin}', '${fullname}', '${imgURL}'),\n`; | |
}); | |
console.log(sql); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment