Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitter_unfollow_tool-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitter_unfollow_tool-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

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

Hashes for twitter_unfollow_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de75376b7c49e8435bf50e7780cc3735dfc79a53b4490a6636b07e1399b78263
MD5 c5189762545c9ac3112c12b8c67509c5
BLAKE2b-256 d5638996a8937a8593dbfccb408c1304342376606fe41aee9cc753723120ffc0

See more details on using hashes here.

File details

Details for the file twitter_unfollow_tool-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for twitter_unfollow_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcbfd29160ae8d708f9e2108fc8c4356d5c958bef5ff01959529ede45b790e38
MD5 ed5804ff8be1cfbbf41f221675de3255
BLAKE2b-256 746687e2ae0861bdf1a7775ad2b3f5c575302b3ec4033d6c42fc6ebe44fecb20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page