Skip to content

Instantly share code, notes, and snippets.

View rutenkolk's full-sized avatar

Kristin Rutenkolk rutenkolk

View GitHub Profile
@rutenkolk
rutenkolk / delchosts.sh
Created June 7, 2023 09:39 — forked from NoraCodes/delchosts.sh
Script to delete your chosts (Cohost posts) one page at a time
# 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