Skip to content

Instantly share code, notes, and snippets.

@timmc
Last active April 30, 2022 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmc/83b61244ad266cd8721173cc25e4672c to your computer and use it in GitHub Desktop.
Save timmc/83b61244ad266cd8721173cc25e4672c to your computer and use it in GitHub Desktop.
Delete all Twitter posts and faves without a developer key
  • Request archive, wait for them to generate it, download it
  • Open Network Tab
  • Delete a tweet
  • Find a POST to DeleteTweet
  • "Copy as curl"
  • Save to file deltw.sh and mark as executable
  • Add -sS -o /dev/null -w '%{http_code}\n' to the end
  • Replace the tweet ID (just the numbers) with '$1'

Run this:

unzip -p twitter-archive.zip data/tweet.js | tail -c+26 | jq '.[]|.tweet.id' -r | while IFS= read -r tweet_id; do deltw.sh "$tweet_id"; sleep 2.0; done

Make a similar script for unfavoriting tweets, and use this to unfavorite everything:

unzip -p twitter-archive.zip data/like.js | tail -c+25 | jq '.[]|.like.tweetId' -r | while IFS= read -r tweet_id; do unfav.sh "$tweet_id"; sleep 2.0; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment