My Twitter account is very old and I'm trying re-active it. It also seemed to be infested with a lot of bots from ~2012. I started with 14k followers and 10k following. I wrote these scripts to decide who I could unfollow from these old accounts, and who I could force to unfollow me (block/unblock=unfollow) in an attempt to get more recently active people to see my content.
pnpm i- Copy
.env.exampleas.envand add variables- Get API keys at Twitter
- Find user ID using TweeterId.com
- Copy
allowlist.example.jsontoallowlist.jsonand add more people to exclude from the unfollow command
pnpm run start- You will find a
followers-YYYY-MM-DD.jsonand afollowing-YYYY-MM-DD.jsonin thecachefolder. - It will report the difference compared to the last day you have in your cache, listing who you followed, unfollowed, and who followed, or unfollowed you
pnpm run unfollowwill start the script- onAllowlist Users on the
allowlist.jsonare skipped - isFollower Users who follow you are skipped
- isUnderground Users who have more than a ratio of 1:2 followers to following & less than 10k followers are skipped
- isPopular Users who have more than a ratio of 1:20 followers to following & more than 10k followers are skipped
- isBot If a user follows more than 4k people (they are not actually engaging), or has less than 100 followers, or has a ratio less than 1:1
pnpm run beta:tweetsgets the latest 100 tweets from everyone who follows youpnpm run beta:blockBotsblocks & unblocks everyone (forcing them to unfollow you) who hasn't tweeted in 5 years, has [less than 10 tweets & 10 followers & 10 following], has never tweeted, or has protected their tweets from being read