Last active
July 31, 2024 16:20
-
-
Save jwahdatehagh/899993491e37b85cfd4caece005d07a0 to your computer and use it in GitHub Desktop.
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
// Change these values | |
const COLLECTION_ADDRESS = "0xabc123" | |
const API_KEY = "b128..." | |
const START_ID = 1 | |
const END_ID = 152 | |
// Leave the below alone... | |
// Paste the entire file into the browser console and hit "Enter". | |
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)) | |
let id = START_ID | |
while (id <= END_ID) { | |
await fetch(`https://api.opensea.io/api/v2/chain/ethereum/contract/${COLLECTION_ADDRESS}/nfts/${id}/refresh`, { | |
"headers": { | |
"accept": "*/*", | |
"x-api-key": API_KEY | |
}, | |
"method": "POST", | |
}) | |
await delay(300) | |
id++ | |
} |
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
// Change these values | |
const COLLECTION_ADDRESS = "0xabc123" | |
const API_KEY = "b128..." | |
const IDS = [1, 2, 3] | |
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)) | |
for (const id of IDS) { | |
await fetch(`https://api.opensea.io/api/v2/chain/ethereum/contract/${COLLECTION_ADDRESS}/nfts/${id}/refresh`, { | |
"headers": { | |
"accept": "*/*", | |
"x-api-key": API_KEY | |
}, | |
"method": "POST", | |
}) | |
await delay(300) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment