Starting February 9, Twitter will no longer support free access to the Twitter API, both v2 and v1.1. A paid basic tier will be available instead. I won't be paying for it. So I no longer plan to maintain or test this project. The script should work fine anyway.
According to birdman, Twitter will soon start freeing the name space of inactive accounts. Here's a script to check if your favorite Twitter handle is available, from the command line OR receive an email notification when the username is available.
- Access to the Twitter API
- Python (tested on v3.10.8)
- Tweepy (tested on v4.12.1) (
pip install tweepy) - schedule 1.1.0 (
pip install schedule)
- Get your Twitter
consumer_key,consumer_secret,access_token, andaccess_token_secret - Install Tweepy
pip install tweepy - Edit the twitter-checker.py script and add the variables
- Run
python3 twitter-checker.py usernameand wait for the results
- Make twitter-checker.py executable,
chmod +x twitter-checker.py - Add twitter-checker.py to your dot file (.zshrc, .bashrc, etc.)
- Set an alias like
alias twitter="python3 twittercheck.py" - Now you can check Twitter username availability with the command
twitter username
Use the twitter-checker-mail.py and tweak the variables. You'll receive an email when the username is available. Be mindful about schedule.every(5).minutes.do(check_user), though. Every five minutes, an API call is made.
