Coder Social home page Coder Social logo

twitter-follower-curator-bot's Introduction

twitter-follower-curator-bot

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.

Setup

  • pnpm i
  • Copy .env.example as .env and add variables
  • Copy allowlist.example.json to allowlist.json and add more people to exclude from the unfollow command

Usage

Getting your current following and followers lists

  • pnpm run start
  • You will find a followers-YYYY-MM-DD.json and a following-YYYY-MM-DD.json in the cache folder.
  • 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

Auto-unfollowing

  • pnpm run unfollow will start the script
  • onAllowlist Users on the allowlist.json are 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

Force users to unfollow you

  • pnpm run beta:tweets gets the latest 100 tweets from everyone who follows you
  • pnpm run beta:blockBots blocks & 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

twitter-follower-curator-bot's People

Contributors

pascalpixel avatar

Stargazers

Thomas Leon Highbaugh avatar Gerardo Cotera avatar Victor Oluwayemi avatar silverboi - avatar Naftali Murgor avatar Chris Messina avatar

Watchers

James Cloos avatar  avatar

twitter-follower-curator-bot's Issues

Unexpected end of JSON input on start script

I did a fresh install and supplied it with Twitter API 2.0 credentials and now get this error when running pnpm run start

❯ pnpm run start                                                                                     13:41 Lise

> @ start /Users/joostschuur/Code/Misc/twitter-follower-curator-bot
> ts-node ./scripts/main.ts

Starting...
Starting cacheTwitterUsers("followers")...
Getting followers... x
Got 999 followers.
Getting followers... REDACTED
Got 1771 followers.
Done cacheTwitterUsers("followers")!
Starting cacheTwitterUsers("following")...
Getting following... x
Got 887 following.
Done cacheTwitterUsers("following")!
Starting diffTwitterUserCaches("followers")...
/Users/joostschuur/Code/Misc/twitter-follower-curator-bot/utils/diffTwitterUserCaches.ts:26
  const usersCurrent: UserV2[] = JSON.parse(mostRecentFileData);
                                      ^
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at diffTwitterUserCaches (/Users/joostschuur/Code/Misc/twitter-follower-curator-bot/utils/diffTwitterUserCaches.ts:26:39)
    at async main (/Users/joostschuur/Code/Misc/twitter-follower-curator-bot/scripts/main.ts:10:3)

The first time around it actually complained because no cache direcvory existed, so the above error only began when I manually created one in the project root dir.

[Error: ENOENT: no such file or directory, open '/Users/joostschuur/Code/Misc/twitter-follower-curator-bot/cache/followers-2023-02-06.json'] {

Ultimately, it did generate a followers-2023-02-06.json and following-2023-02-06.json fine with what seems like the right lists though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.