diff --git a/data/nano-reps.csv b/data/nano-reps.csv index fd7fbcca..a35fc163 100644 --- a/data/nano-reps.csv +++ b/data/nano-reps.csv @@ -117,7 +117,7 @@ ranita | NanoHispano,nano_1hispanocq7ow8azrs3mirsccebuh5e3pfk8pkfzfafbyooezpsnwi Redeemfor.me 🛍️🛒 — Luckynano.com 🎰💰,nano_1oenixj4qtpfcembga9kqwggkb87wooicfy5df8nhdywrjrrqxk7or4gz15b,emulord,Emul0rd,null,null,null,Emulord repnode.org,nano_3rpixaxmgdws7nk7sx6owp8d8becj9ei5nef6qiwokgycsy9ufytjwgj6eg9,null,null,null,null,null,null RsNano.com - Nano Rust Port,nano_1tk8h3yzkibbsti8upkfa69wqafz6mzfzgu8bu5edaay9k7hidqdunpr4tb6,gschauwecker,SeniorTawny,gschauwecker,rsnano.com,null,null -ScandiNode 🌐 Green, fast & capable! ,nano_318uu1tsbios3kp4dts5b6zy1y49uyb88jajfjyxwmozht8unaxeb43keork,kevorkc,kevorkdk,null,null,null,null +"ScandiNode 🌐 Green, fast & capable! ",nano_318uu1tsbios3kp4dts5b6zy1y49uyb88jajfjyxwmozht8unaxeb43keork,kevorkc,kevorkdk,null,null,null,null scoin.cool,nano_3o5oeefdnrha7x7styp1tnmefen7fnrooy4jgnfb1otws54yf7uqfuxmojoy,null,null,null,null,null,AviGopal SendNudes 👀,nano_3sendnudez9x8zkaid5k17g474f9dc4fuopggzojwop9sbc5isgwah5gbx9n,user_8804 - Gab Parrot#8804,user_8804,Gab_Parrot,null,null,gabparrot SomeNano.com,nano_1buid1zd65fynxnsmzyjgt1yd84cjrf81xa1mn861wtxmer5ss74bd8kbe4a,pwlk.,somenano.com diff --git a/scripts/generate-nano-reps.mjs b/scripts/generate-nano-reps.mjs index 044523b1..d1dd56bc 100644 --- a/scripts/generate-nano-reps.mjs +++ b/scripts/generate-nano-reps.mjs @@ -35,7 +35,17 @@ const generate_nano_reps = async () => { ) // Read the downloaded CSV data const csv_reps = await read_csv(csv_download_path, { - mapValues: ({ header, index, value }) => (value === '' ? null : value) + mapValues: ({ header, index, value }) => { + if (value === '') { + return null + } + + if (header === 'alias') { + return value.replace(/"/g, '') + } + + return value + } }) // Fetch representatives data from the database @@ -157,6 +167,14 @@ const generate_nano_reps = async () => { return alias_a.localeCompare(alias_b) }) + // escape any commas in alias + for (const rep of results) { + // check if alias contains a comma + if (rep.alias.includes(',')) { + rep.alias = `"${rep.alias}"` + } + } + // Convert results to CSV and save const csv_headers = {} for (const field of Object.keys(results[0])) {