JSFiddle - React, Tailwind, and code Playground

by ZeNz0r

JavaScript

let csv = '' 
const traits = ["Background",
  "Bear Base",
  "Eyes",
  "Hair",
  "Low Ornaments",
  "Mouth",
  "Special Ornaments",
  "Top Sparkles"
]

for (let i = 6501; i <= 6969; i++) {
  let link = 'https://nodebears.mypinata.cloud/ipfs/Qmdocm7rfbk7Fe5VnrQAMFRbQR2hg5guHwqLpqihaazaDt/' + i + '.json'
      let attr = ''

fetch(link)
    .then(response => response.json())
    .then(data => {
      traits.map(trait => {
        let cur = data.attributes.filter(attr => attr.trait_type === trait)
        attr += ((cur.length === 0) ? ' ' : cur[0].value) + ', '
      })
      csv = i + ', https://nodebears.mypinata.cloud/ipfs/Qmdocm7rfbk7Fe5VnrQAMFRbQR2hg5guHwqLpqihaazaDt/' + i + '.json, https://nodebears.mypinata.cloud/ipfs/Qmdocm7rfbk7Fe5VnrQAMFRbQR2hg5guHwqLpqihaazaDt/' + i + '.png, ' + attr
  //console.log(attr)
  console.log(csv)
})

}