Created
June 6, 2023 01:20
-
-
Save NoraCodes/28066f686a609a3dd467b7b468ecf515 to your computer and use it in GitHub Desktop.
Script to delete your chosts (Cohost posts) one page at a time
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
# You have to go into devtools and pull out your Cookie: header including the part that says Cookie: | |
# and replace YOUR COOKIE HEADER with that | |
# and replace YOUR PROJECT NAME in two places | |
for item in $(curl https://cohost.org/api/v1/project/YOUR PROJECT NAME/posts | jq ".items[] | objects | .postId"); do | |
curl 'https://cohost.org/api/v1/trpc/posts.delete?batch=1' \ | |
-X POST -H 'content-type: application/json' \ | |
-H 'Origin: https://cohost.org' \ | |
-H 'YOUR COOKIE HEADER' \ | |
--data-raw \{\"0\":\{\"projectHandle\":\"YOUR PROJECT NAME\",\"postId\":$item\}\} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment