Package: botblocker
Python program to identify and block your bot followers on TwitterRequires 3.4 <= Python <= 3.7Getting StartedThese instructions will get you a copy of the project up and running on
your local machine for development and testing purposes.InstallingOnly if you use Python >= 3.7, you have to run this command first:sudo pip install https://github.com/tweepy/tweepy/archive/master.zipNow, no matter what Python version you’re using (if it fits the requirement), the easiest way is installing using pip:sudo pip install botblockerYou can also clone this project using git:git clone https://github.com/yanorestes/botblocker.git
cd botblocker
python setup.py installPreparationAt first, setting things up to botblocker may sound overcomplicated.
However, following this step-by-step tutorial will ensure an easy
proceedment! Still, this “hard” part of the tutorial will have to be
followed only once ;)!1 - Getting your Twitter Developer AccountAs I’m providing the complete code of this project, I can’t let you guys
use my API keys, so you need to get them yourselves. This is how you do
it:Accessthis linkto
associate your Twitter profile with a developer accountClick inContinueCheck “I am requesting access for my own personal use”Type in your username on the field belowSelect the country you live and pressContinueCheck “Consumer / end-user experience”In the textbox below, type something similar to the following example
(note that it is better not to copy the whole text, so that your
application will be approved faster):The project I'm building aims to identify and block follower bots. It is based on programming language Python, using Tweepy to connect to Twitter API and Botometer to identify bots. The project gives the user mutiple options on identifying and blocking the bots, resulting in a clean and simple usage. Botometer analizes each profile basing itself on the tweets and the specs of the profile, to, then, calculate a result (a score from 0 to 5; the higher, the more likely it is that the profile is indeed a bot). None of the results are shared with anyone or kept with us.CheckNoand clickContinueScroll through the terms of service and check the “read and agree”
boxClick on “Submit application”Check your email account and confirm your emailWait for your Developer Account to get approved2 - Getting your Twitter API KeysOnce your Developer Account gets approved, you can pass on to creating
an app:Accessthis linkto register your appChose an authentic name to your app and fill the first fieldIn the textbox below, type something similar to the following
example:Python program to identify and block your bot followers on Twitter.Pastehttps://github.com/yanorestes/botblockeron the field belowSkip to the last textbox and type in something similar to the
following example:The project I'm building aims to identify and block follower bots. It is based on programming language Python, using Tweepy to connect to Twitter API and Botometer to identify bots. The project gives the user mutiple options on identifying and blocking the bots, resulting in a clean and simple usage.Click onCreateand confirmYou will be redirected to your app’s page. Then:Access the “Keys and tokens” tabSave the two keys under “Consumer API keys” somewhere. The first is
your Consumer Key and the second is your Consumer Secret Key. You
will need both of them later configuring botblocker:3 - Getting your Mashape API KeyWith your Twitter API keys in hands, you’ll only have to get your
Mashape API Key. Follow these steps in order to do so:Accessthis linkand register an
account (I recommend signing up with GitHub, but there are other
options)If you have a credit card available (you won’t have to pay a single
dollar, don’t worry!), accessthis
link, click onPricingand subscribe to the Basic Free Plan. If you don’t, you
can usethis link.
The first link will (probably) make the program run faster.Onthis link, copy
your personal “X-Mashape-Key” on the request example code and save
somewhere:UsingNow it’s time to finally run botblocker! Botblocker you’ll go through
all of your followers and calculate a “bot score” of them. The score
goes from 0 to 5. The higher the score, the more likely is the chance
the profile is a bot. The default behaviour is to automatically block every profile identified as a bot.If you installed the package using pip, you can simply run botblocker in
the command line:botblocker [-h] [-c] [--noblock] [--saveallowlist] [--softblock] [--report] [-l {1,2,3}] -u USER [-v]These are the parameters you can use:-hor--help- Shows a help message and exit-cor--config- (Re)configure usage settings. At least once,
you’ll have to do this.--noblock- Don’t block anyone automatically. This is not recommended, especially for profiles with lots of followers, as you may lose all the running progress if you exit early.--saveallowlist- Save users identified as non-bots to an
allowlist. Recommended.--softblock- Do soft block (block and unblock right after)-ror--report- Report users identified as bots to Twitter-l{1,2,3}or-level{1,2,3}- Choose level of rigorosity to
use to identify bots. Level 1 only consider bots those with score >=
4, level 2 (default) considere those with score >= 3 and level 3
considere those with score >= 2.5.-uUSERor-userUSER- The Twitter username you want to run
botblocker for. Required.-vor--version- Get the current version of botblockerYou can also run the script directly bybotblocker.py:python -W ignore -m botblocker [-h] [-c] [--noblock] [--saveallowlist] [--softblock] [--report] [-l {1,2,3}] -u USER [-v]ContributingI’m accepting pull requests that improve speed and legibility of the
code.AuthorsYan Orestes-Initial work-yanorestesLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.