Skip to content

Instantly share code, notes, and snippets.

@xavierfiechter
Created June 9, 2021 13:09
Show Gist options
  • Save xavierfiechter/b6c60db9483df5506f86e095188cc178 to your computer and use it in GitHub Desktop.
Save xavierfiechter/b6c60db9483df5506f86e095188cc178 to your computer and use it in GitHub Desktop.
Automate Bitcoin Twitter Hygiene
virtualenv -p python3.9 BlockTwitter
cd BlockTwitter && . ./bin/activate
pip install tweepy
wget https://raw.githubusercontent.com/NicolasDorier/CancelMSM/master/BlockTwitter.side
# Apply for Twitter API access here: https://developer.twitter.com/en/products/twitter-api
# YOUR TWITTER API CREDENTIALS BELOW
consumer_key = ""
consumer_secret = ""
access_token = "-"
access_token_secret = ""
# ==================================
import json
import tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
api.verify_credentials()
f = open('BlockTwitter.side',)
data = json.load(f)
f.close()
for i in data.get('tests')[0].get('commands'):
name = i.get('target')
if name.startswith("/"):
try:
_ = api.create_block(name[1:])
except:
pass
# Now verify if everything is blocked as expected, https://twitter.com/settings/blocked/all
# Next, send me two Sats to let me know that this is useful for you and everything worked fine. :-)
# https://tippin.me/@xavierfiechter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment