Skip to content

Instantly share code, notes, and snippets.

@VictorHaine
Last active June 9, 2024 10:36
Show Gist options
  • Select an option

  • Save VictorHaine/35ef648a985825ebf2cda024cfd60d2d to your computer and use it in GitHub Desktop.

Select an option

Save VictorHaine/35ef648a985825ebf2cda024cfd60d2d to your computer and use it in GitHub Desktop.
Mas delete selected chatgpt chats
// Scroll all the day down to the last conversation
// Capture the List of chats using xPath
let chats = $x('//*[@id="__next"]/div[1]/div[1]/div/div/div/div/nav/div[2]/div[3]/div/div/ol/li/div/a')
// Extract chat names and ids
let chatNamesAndIds = chats.map(function(c) {
return {
name: c.innerText,
id: c.href.replace('https://chatgpt.com/c/', '')
}
})
// Log var to console and click "copy object"
chatNamesAndIds
// Paste the json on your favorite editor and chose the ids to delete
const ids = [
"4c15e8c2-146f-4321-2345-789d12295a98",
// Put the other other ids here
]
// Bye delete annoying delete confirmation!!!
ids.map(function(id) {
// Change the ID on the first on line 23 and 40 if you copied and pasted a new fetch request from networks tab
fetch("https://chatgpt.com/backend-api/conversation/" + id, {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7,es;q=0.6",
// Change to your breaker token or get a new one from console after deleting a cheat (easyer method)
"authorization": "Bearer asdfasdfasf",
"content-type": "application/json",
"oai-device-id": "350dd62d-f47a-4d5b-a9ef-3e20843b5eb8",
"oai-language": "en-US",
"priority": "u=1, i",
"sec-ch-ua": "\"Google Chrome\";v=\"125\", \"Chromium\";v=\"125\", \"Not.A/Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "https://chatgpt.com/c/" + id,
"referrerPolicy": "strict-origin-when-cross-origin",
"body": "{\"is_visible\":false}",
"method": "PATCH",
"mode": "cors",
"credentials": "include"
});
});
// Be happy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment