This is both annoying and potentially dangerous – if a user follows a bunch of people who were previously blocked, it:
Alerts those people that they're no longer blocked
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
I created a fresh Twitter account and blocked two accounts.
I followed the steps in the README, using the original code, and called main() twice – and confirmed I saw the original bug.
I reblocked the two accounts.
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.
This is both annoying and potentially dangerous – if a user follows a bunch of people who were previously blocked, it:
This modifies the script not to click the button if it’s already been clicked at least once – avoiding this failure mode.
Testing
main()
twice – and confirmed I saw the original bug.main()
once, and both accounts were unblocked. I calledmain()
a second time, and confirmed I hadn’t started following those two users.