Git Product home page Git Product logo

unblock-all's Introduction

unblock-all

A javascript script that unblocks all of a Twitter user's blocked Twitter accounts

Overview

Unblocking everyone blocked on Twitter involves navigating to the blocked accounts (https://twitter.com/settings/blocked) page, scrolling down to the bottom until webpage loads the next few accounts, and then clicking the Ublock button one by one. This script attempts to automate the process of scrolling until everyone is loaded, finding the block buttons, and automatically clicking them. The unblock.js script performs each of those tasks by scrolling to the bottom of the page, waiting for it to load via a set timeout, and then continuing to scroll until it observes no difference in scroll height. Once the script can no longer scroll, it finds all of the unblock buttons, by searching for the 'blocked-text' class elements (ร  la https://gist.github.com/themorgantown/3e3e6a42e17ebcbc766c) and clicking on each of them individually.

Usage

  1. Open Google Chrome
  2. Navigate to https://twitter.com/settings/blocked
  • Sign in, if necessary
  1. Disable or whitelist any adblock or similar blocking extensions (just in case --- I have no idea if this is a problem)
  2. Open the Javascript Console:
  • Windows/Linux: Ctrl + Shift + J
  • OS X: Cmd + Option +J
  1. Paste the contents of unblock.js into the Console window. Press Enter.
  2. Type main(). Press Enter.
  • Alternatively, type unblock(timeoutInMilliseconds, maximumNumberOfScrolls) for a custom timeout in milliseconds and max number of scrolls.
  1. Let it chooch
  2. When the dialog pops up, verify that the number of blocked accounts obtained makes sense
  • Click Ok/Yes to unblock every account
  • Click Cancel/No to do nothing
  1. Refresh the page to verify that accounts have been unblocked

Issues

  • If you accidentally run the unblock script twice (via either main() or unblock(...)) without reloading, you will follow everyone you just unblocked.

If this occurs:

  • DO NOT RELOAD THE PAGE
  • Run the script again
  • Press Ok/Yes to "unblock" every account. The button clicked by the script remains the same, but will instead unfollow the accounts.

unblock-all's People

Contributors

jmcgover 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

Watchers

 avatar  avatar  avatar

unblock-all's Issues

Small issue, plus comments

Thanks for sharing this, even after a couple of years this still helped me to clean up after reporting a lot of accounts.

Small issue: a missing ';' at the end of the line of 'var unblockButton'.

Update for UNBLOCKING, the line should now be:
var unblockButtons = document.getElementsByClassName("unblock-text");

Addition for UNMUTING, change the line to:
var unblockButtons = document.getElementsByClassName("unmute-user-item");

I refreshed the page a couple of times because of the great number of items, then re-pasted the script in , before calling main() again.

Maximum requests.

4/4/2019

It appears that Twitter now has a maximum number of requests it's allowed to do so this code will not work unless the loop is limited to the maximum number of requests.

Tested with a block list of 62k people and it seems to jam up around 100 but I didn't count.

blocked-text class name no longer exists

the blocked-text class name is no longer used; however, replacing the getElementsByClassName with document.querySelectorAll('div[role="button"][aria-label="Blocked"]') seems to work. Twitter also no longer keeps all the elements on the page as you scroll, so it's necessary to unblock in a loop.

feature question

Hi,

Is there a way to force this to do ALL of my blocked accounts? Right now, it does 18 at a time. I have over 80,000 to do (long story....!). Any assistance would be appreciated!
Thanks.

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.