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
javascript:(function(){ | |
// Author: Ross Jacobs | |
// Purpose: Use as a browser bookmarklet to bulk delete notion pages in trash | |
// License: Apache 2.0 | |
async function getSpaceId() { | |
resp = await fetch("https://www.notion.so/api/v3/loadUserContent", {"credentials":"include","headers":{"accept":"*/*","cache-control":"no-cache","content-type":"application/json","pragma":"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin"},"referrerPolicy":"same-origin","body":"{}","method":"POST","mode":"cors"}); | |
json = await resp.json(); | |
spaceId = Object.keys(json.recordMap.space)[0]; | |
return spaceId; | |
} |