Last active
February 12, 2022 05:47
-
-
Save caffeinum/f98bbb629801304c8797aef3e2dcaf25 to your computer and use it in GitHub Desktop.
Force Update Opensea
This file contains 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
// use this on https://api.opensea.io/api/v1/ | |
// in browser console | |
const startIndex = 0 // use to skip N first | |
const collection = "0x78569146f5635a31dd2ce08ea614360e8be7315d" | |
const getOpenSeaURL = id => `https://api.opensea.io/api/v1/asset/${collection}/${id}?force_update=true` | |
DELAY = 200 // ms | |
await Promise.all(Array(3333).fill(null).reduce(async (promise, imageUrl, index) => { | |
await promise; | |
const url = getOpenSeaURL(index) | |
if (index < startIndex) { | |
console.log('Skipping', index, url) | |
return Promise.resolve() | |
} else { | |
console.log('Processing', index, url) | |
} | |
fetch(url) // intentionally we dont wait until it returns | |
await new Promise(resolve => setTimeout(resolve, DELAY)) | |
return | |
}, Promise.resolve())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment