Twitterの非相互フォローを検出・解除するPythonライブラリ
Project description
twitter-unfollow-tool
Twitterの非相互フォローを自動で検出・解除できるPythonライブラリです。
🔧 機能一覧
- Twitterのフォロー中・フォロワーを自動で取得
- 非相互フォロー(フォロー返しされていない相手)を抽出
- CSVに保存
- CSVに基づいた自動アンフォロー処理
- アカウントBANの可能性を限りなく0に近くした設計
- 今後も機能の追加の可能性があります
📦 インストール方法
pip install twitter-unfollow-tool
⚠️ 注意事項
- Twitterにログイン済みのプロファイルを使ってください
- EdgeやChromeのすべてのウィンドウを閉じてから実行してください(ユーザーデータがロックされるため)
- TwitterのUI変更により、今後動作しなくなる可能性があります
- バグ報告は blackokayu@yahoo.co.jp までお願いします
🚀 使用例
from selenium import webdriver
from selenium.webdriver.edge.options import Options
from twitter_unfollow_tool import (
scroll_until_loaded,
get_followings,
get_followers,
get_non_mutuals,
save_usernames_to_csv,
load_usernames_from_csv,
unfollow_users
)
# Edgeのログイン済みプロフィールを起動(ChromeでもOK)
options = Options()
options.add_argument("user-data-dir=C:/Users/your_name/AppData/Local/Microsoft/Edge/User Data")
options.add_argument("profile-directory=Default")
driver = webdriver.Edge(options=options)
driver.get("https://twitter.com/your_username")
input("▶ ページが開いたら Enter を押してください...")
# フォロー中・フォロワー一覧を取得
scroll_until_loaded(driver, mode="following")
followings = get_followings(driver)
scroll_until_loaded(driver, mode="followers")
followers = get_followers(driver)
# 非相互を抽出しCSV保存
non_mutuals = get_non_mutuals(followings, followers)
save_usernames_to_csv(non_mutuals, "non_mutuals.csv", limit=30)
# CSVから読み込み、自動でアンフォロー
usernames = load_usernames_from_csv("non_mutuals.csv")
unfollow_users(driver, usernames, max_unfollow=10)
driver.quit()
📄 ライセンス
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twitter_unfollow_tool-0.1.0.tar.gz.
File metadata
- Download URL: twitter_unfollow_tool-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de75376b7c49e8435bf50e7780cc3735dfc79a53b4490a6636b07e1399b78263
|
|
| MD5 |
c5189762545c9ac3112c12b8c67509c5
|
|
| BLAKE2b-256 |
d5638996a8937a8593dbfccb408c1304342376606fe41aee9cc753723120ffc0
|
File details
Details for the file twitter_unfollow_tool-0.1.0-py3-none-any.whl.
File metadata
- Download URL: twitter_unfollow_tool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcbfd29160ae8d708f9e2108fc8c4356d5c958bef5ff01959529ede45b790e38
|
|
| MD5 |
ed5804ff8be1cfbbf41f221675de3255
|
|
| BLAKE2b-256 |
746687e2ae0861bdf1a7775ad2b3f5c575302b3ec4033d6c42fc6ebe44fecb20
|