Code Monkey home page Code Monkey logo

twitter-purge's Introduction

twitter-purge

Unfollows a list of accounts you're following that haven't tweeted in over 30 days.

Getting started

Make sure to have ruby installed (you can use rvm), and then install dependencies with bundler:

bundle install

Set the required environment variables in .env containing your twitter API credentials:

  • TWITTER_CONSUMER_KEY
  • TWITTER_CONSUMER_SECRET
  • TWITTER_ACCESS_TOKEN_KEY
  • TWITTER_ACCESS_TOKEN_SECRET

You can use the sample env file for reference:

mv .env.sample .env

You can get Twitter API credentials from the Twitter apps page.

Run the script passing your username:

$ ruby purge.rb @username

Twitter account: @username
following count: 4154
checking user: 45409867
checking user: 133008925
checking user: 26318018
...

The script will check if the user has tweeted in the last 30 days. If they haven't tweeted in that timeframe, then it will unfollow them. The script creates a .cache file containing checked users so if the script is halted you can resume skipping already checked users. The script is simple and easy to modify to your own criteria.

License

MIT

twitter-purge's People

Contributors

miguelmota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fdovila

twitter-purge's Issues

Can you give a sample .env file format with dummy data?

after cloning locally, I am unsure what my next step is. Do I just need to create a .env file? If so, how should the code be formatted? I tried several variations, but had no luck gaining access with my twitter dev creds.

Does any other file need to be modified before running the program?

Thank you for making this helpful program!

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.