jmcgover / unblock-all

A javascript script that unblocks all of a Twitter user's blocked Twitter accounts
MIT License
30 stars 20 forks source link

If you run the script twice, don't follow all the accounts you just unblocked #3

Open alexwlchan opened 6 years ago

alexwlchan commented 6 years ago

This is both annoying and potentially dangerous – if a user follows a bunch of people who were previously blocked, it:

  1. Alerts those people that they're no longer blocked
  2. Flags the user to those people, potentially making them a target for harassment or abuse

This modifies the script not to click the button if it’s already been clicked at least once – avoiding this failure mode.

Testing

  1. I created a fresh Twitter account and blocked two accounts.
  2. I followed the steps in the README, using the original code, and called main() twice – and confirmed I saw the original bug.
  3. I reblocked the two accounts.
  4. I ran the new version of the script. I called main() once, and both accounts were unblocked. I called main() a second time, and confirmed I hadn’t started following those two users.