GithubHelp home page GithubHelp logo

twitter-unfollow's Introduction

twitter-unfollow

My goal for the next months is to spend less time on social media and more time creating. Instead of reacting to things, I want to focus on having a bigger vision, planning things ahead and doing what has the highest impact.

I've been reading every single tweet in my timeline for the last 4 years with no interruption.

In total I have over 100 custom mute filters, including custom regexes like (@United|delta|Delta|JetBlue|jetblue)), and muted clients like Buffer

It's time for me to stop reading so much on social media portals, and focus on reading books instead.

I'll still follow a small amount of people via Twitter lists, since there are certain things I really don't want to miss

unfollow.gif

View full blog post on my Twitter setup

This script does the following:

  • Unfollow everybody
  • Puts them into a list called "Old Follows"
  • Store the usernames of everyone in unfollowed_usernames.txt (this allows you to pretty easily follow everyone again when you feel like it)
  • Store the usernames, together with full name and bio into unfollowed_full_names.txt (this allows you to search for users)
bundle install
bundle exec ruby unfollow.rb

Notes:

  • Make sure to have DMs open to still be able to chat with your friends.
  • Use a list to follow a small subset of people. This way you follow 0 people and nobody feels left out. The list can be private.
  • Make sure to create a list called "Old Follows"

Technical Notes

  • Create your application via Twitter Apps
  • Set the following environment variables
    • ENV["CONSUMER_KEY"]
    • ENV["CONSUMER_SECRET"]
    • ENV["ACCESS_TOKEN"]
    • ENV["ACCESS_TOKEN_SECRET"]
  • Due to the API limits this script can only unfollow about 420 people per run. You'll need to regenerate keys after this ๐Ÿคทโ€โ™€๏ธ

View full blog post on my Twitter setup

twitter-unfollow's People

Contributors

krausefx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

twitter-unfollow's Issues

Error: tried to create Proc object without a block (ArgumentError)

Hi,

I have no knowledge of Ruby, so I simply downloaded your script and managed to run it. I get the following error:

C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday/options.rb:160:in `new': tried to create Proc object without a block (ArgumentError)
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday/options.rb:160:in `memoized'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday/options.rb:241:in `<class:ProxyOptions>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday/options.rb:223:in `<module:Faraday>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday/options.rb:1:in `<top (required)>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday.rb:77:in `require'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday.rb:77:in `block in require_libs'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday.rb:76:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday.rb:76:in `require_libs'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday.rb:237:in `<module:Faraday>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.11.0/lib/faraday.rb:16:in `<top (required)>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/twitter-6.1.0/lib/twitter/rest/request.rb:2:in `require'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/twitter-6.1.0/lib/twitter/rest/request.rb:2:in `<top (required)>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/twitter-6.1.0/lib/twitter/cursor.rb:2:in `require'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/twitter-6.1.0/lib/twitter/cursor.rb:2:in `<top (required)>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/twitter-6.1.0/lib/twitter.rb:3:in `require'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/twitter-6.1.0/lib/twitter.rb:3:in `<top (required)>'
        from unfollow.rb:1:in `require'
        from unfollow.rb:1:in `<main>'

How can I fix it?

Twitter::Error::Forbidden

Hi Felix,

I love the idea and would like to use it for my twitter account.

Unfortunately Twitter forbids the access to my account. I only follow 250 people and my API, ACCESS Keys are all right. I saw that the Error Code meant that I have exceeded Twitter's APIs limits (source: https://dev.twitter.com/overview/api/response-codes, https://support.twitter.com/articles/15364).

Do you know how to fix that?

Thank you in advance.

This is my output:

/Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/response/raise_error.rb:12:in `on_complete': Unable to verify your credentials (Twitter::Error::Forbidden)
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/response.rb:9:in `block in call'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/response.rb:61:in `on_complete'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/response.rb:8:in `call'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/request/url_encoded.rb:15:in `call'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/request/multipart.rb:14:in `call'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/request/multipart_with_file.rb:21:in `call'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/rack_builder.rb:139:in `build_response'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/connection.rb:377:in `run_request'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/faraday-0.11.0/lib/faraday/connection.rb:177:in `post'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/request.rb:33:in `perform'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/utils.rb:50:in `perform_request'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/utils.rb:72:in `perform_request_with_object'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/utils.rb:64:in `perform_post_with_object'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/oauth.rb:29:in `token'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/headers.rb:38:in `auth_header'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/headers.rb:27:in `request_headers'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/request.rb:31:in `perform'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/utils.rb:50:in `perform_request'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/utils.rb:95:in `perform_request_with_objects'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/utils.rb:139:in `objects_from_response_with_user'
  from /Users/micky-mouse/.rvm/gems/ruby-2.4.0/gems/twitter-6.1.0/lib/twitter/rest/lists.rb:34:in `lists'
  from unfollow.rb:21:in `old_follows_list'
  from unfollow.rb:5:in `run'
  from unfollow.rb:34:in `<main>'

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.