Skip to content

Python scripts to visit random Twitter friends, keep track of new followers or unfollowers, and other things.

License

Notifications You must be signed in to change notification settings

Gravecat/TwitKit

Repository files navigation

TwitKit

These are some Python tools I've written for interacting with the Twitter website, with a couple of simple additions for Mastodon. You will need to provide your own API key and access token to make full use of the scripts here. If you do not already have an API key, you'll have to sign up for a developer account. Alternatively, you can use some of the scripts below by providing your own following/followers lists in a text file.

tm_update_list.py -- Takes the output from twitter_check_following.py and a following_accounts.csv downloaded from Mastodon, and combines them into a combined friends file (tm_combined_following.txt) with a randomized order.

tm_visit_friend.py -- Similar to twitter_random.py below, loads the tm_combined_following.txt from tm_update_list.py and opens the web browser to visit each user's page in sequence on their respective website, pushing them to the bottom of the list each time. Optionally, a text file tm_blacklist.txt can be created with a list of usernames which will be skipped.

tweets_only.py -- Given either a command-line argument of one (or more) usernames, or individual usernames typed one at a time in the console if no command-line argument is given, will open a web browser to a search page showing only that user's tweets, and not their retweets.

twitkit_common.py -- Shared code used by the other script files. Does nothing on its own.

twitter_check_followers.py -- Retrieves a list of people following you on Twitter, and stores it in a text file. Subsequent runs of this script will compare your current followers to the last time you checked, and inform you of any new followers/unfollowers. (API keys required.)

twitter_check_both.py -- Runs the scripts from twitter_check_following.py and twitter_check_followers.py (see below for details) both at the same time. (API keys required.)

twitter_check_following.py -- Usng the Twitter APIs, retrieves a list of the people you are currently following and stores them in a text file. Subsequent runs of this script will compare your current following to the last time you checked, and inform you of any changes. (API keys required.)

twitter_compare_followers.py -- Takes the text-file output from twitter_check_followers.py and twitter_check_following.py and compares followers, listing which accounts are not following you back, and which ones you are not following back.

twitter_random.py -- Picks a random user from a text file (either generated by twitter_update_followers.py, or you can provide your own) and opens their Twitter page in the default web browser.

About

Python scripts to visit random Twitter friends, keep track of new followers or unfollowers, and other things.

Resources

License

Stars

Watchers

Forks

Languages