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 |
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
#!/usr/bin/env bb | |
(ns script | |
(:require [clojure.java.io :as io] | |
[clojure.string :as s] | |
[clojure.pprint :as pprint] | |
[clojure.java.shell :refer [sh with-sh-dir]] | |
[cheshire.core :as json])) | |
(defn prsh | |
([sh] |