This project allows you to follow your TikTok friends on other social media platforms such as Twitter, Instagram, Threads, and Bluesky after the TikTok shutdown due to the Ban in the United States.
- Authenticate and follow users on Twitter, Instagram, Threads, and Bluesky.
- Securely manage API credentials and tokens.
- Python 3.x
requests
library (pip install requests
)python-dotenv
library (pip install python-dotenv
)
git clone https://github.com/weems/FollowingTiktokFriends.git
cd FollowingTiktokFriends
pip install -r requirements.txt
Create a .env
file in the root directory to store your API credentials. This file should not be committed to version control.
touch .env
Add your credentials to the .env
file:
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
INSTAGRAM_ACCESS_TOKEN=your_instagram_access_token
BLUESKY_ACCESS_TOKEN=your_bluesky_access_token
mastodon_access_token = os.getenv('MASTODON_ACCESS_TOKEN')
mastodon_instance = os.getenv('MASTODON_INSTANCE')
Ensure your script reads the credentials from the .env
file. Example:
from dotenv import load_dotenv
import os
import requests
load_dotenv()
twitter_bearer_token = os.getenv('TWITTER_BEARER_TOKEN')
instagram_access_token = os.getenv('INSTAGRAM_ACCESS_TOKEN')
bluesky_access_token = os.getenv('BLUESKY_ACCESS_TOKEN')
mastodon_access_token = os.getenv('MASTODON_ACCESS_TOKEN')
mastodon_instance = os.getenv('MASTODON_INSTANCE')
# Your script logic here...
Ensure you have a JSON file with TikTok usernames (e.g., tiktok_usernames.json
).
[
"username1",
"username2",
"username3"
]
Run the script:
python script.py
Storing credentials in environment variables helps prevent accidental exposure. Use the python-dotenv
library to load these variables from a .env
file.
Ensure your .env
file is added to .gitignore
to prevent it from being committed to your repository:
echo ".env" >> .gitignore
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.
You can adjust the instructions and details based on your specific implementation and script logic.