natterstefan

natterstefan

Start Over Again and Unmute All Twitter Users.

Start Over Again and Unmute All Twitter Users.

Reset Your Twitter Mute List With Tweepy

Listen to this article

"Twitter is the home of the trolls." You've probably heard this statement many times from your Twitter friends. That's why mute lists might grow all the time. The mute feature ensures that you do not see a tweet from a Twitter user, but you can still visit the user's profile. It is a friendlier way than blocking users. Be aware that muted users can still interact with your profile, you just do not see it. That confused me from time to time. Because I saw that a user interacted with my tweet, but I did not saw the response when I opened the tweet. You can only see it if you open the tweet in another browser.

Tweepy

And so it happened that I wanted to reset my mute list. But that turned out to be a time-consuming task. On the iPhone as well as on the Mac it is tedious to click through all users and unmute them. For this reason, I looked around for a more efficient solution. Thereby I stumbled over Tweepy.

Tweepy is an easy-to-use Python library to access the Twitter API.

I want to tell you upfront that you need a Twitter Developer account and application to use Tweepy. To do this, you need to create an account on developers.twitter.com and create an application. Since Twitter has changed the process, this may take some time. You should keep that in mind.

However, it is the safest and best way to reset the mute list. Other alternatives with JavaScript scripts or browser extensions don't seem to be a good idea.

Install Tweepy

Before you can use Tweepy you have to install it.

pip install tweepy

Use Tweepy to Unmute People

You can either write your own Tweepy script or use the one I found when looking up "how to unmute people on Twitter" on Google. I used this gist by Miguel Garcia to reset my list.

import tweepy

consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth, wait_on_rate_limit=True)
api.verify_credentials()

for u in tweepy.Cursor(api.mutes).items():
    print(f"Unmutting {u.screen_name}")
    api.destroy_mute(u.id)

Add the consumer_key and the other secrets from your Twitter application and start the script with python main.py.

You should see "Unmutting username" in the logs until Tweepy detects the rate limit. It will then stop and continue once it's safe again. Depending on the number of people on your mute list it can take some time to reset it.

That's it. Now you have reset your mute list and start over again.

Further Reading


Share 💛

Do you like this article? Do you want to support me? Tell your friends on Twitter about it. Thank you!

Questions and Feedback

You got any questions or want to add your thoughts? Let me know in the comments below, please.

Let's connect


Image: unsplash.com/photos/BcjdbyKWquw

#twitter#cli#apis
 
Share this