Skip to content

Instantly share code, notes, and snippets.

@caffeinum
Last active February 12, 2022 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caffeinum/f98bbb629801304c8797aef3e2dcaf25 to your computer and use it in GitHub Desktop.
Save caffeinum/f98bbb629801304c8797aef3e2dcaf25 to your computer and use it in GitHub Desktop.
Force Update Opensea
// 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