Skip to content

A Streamlit app that retrieves all the followers of a Twitter account and use Botometer API to check for bots.

Notifications You must be signed in to change notification settings

presstofan/twitter-bot-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter Bot Checker Powered by Botometer

A Streamlit app that retrieves all the followers of a Twitter account and use Botometer API to check for bots. This is essentially a wrapper over the official botometer python library, with a basic user interface powered by Streamlit and SQLite database to store the results.

Demo Animation

How to use

Download and set up the Streamlit app

The app is built with Python 3.7.4 (although other Python versions such as 3.7.x and 3.6.x should also work). It is easier to start fresh with a new virtual environment (e.g. "conda create --name botcheck python=3.7" if you are using conda), then running:

git clone https://github.com/presstofan/twitter-bot-checker
cd twitter-bot-checker
pip install -r requirements.txt
streamlit run app.py

Now, you should be able to see the app at: http://localhost:8501

Get the Twitter and Botometer Rapid API credentials

Please see this page for setting up the credentials. There is a free plan for testing that allows us to check up to 500 accounts per day. If you need more quota, their other paid plans would be ideal.

Use the app to retrieve followers and check for bots

  1. Select the JSON file that contains the Twitter and Botometer credentials. credentials.json is a template of the credential file, which can be found with the app. Credential loaded will be cached for later use.
  2. Provide an existing database. If not provided, the app will look for database in the temp folder. If no cached database available, a new database will be created.
  3. Specify the account whose followers need to be checked, and set the timeframe you want to keep the bot check data.
  4. Run "Retrieve Twitter followers", which uses Tweepy API to retrieve all the followers of a specific account. If a database is provided or cached in the temp folder, the app will only add new followers that are not already in the database. If no database is available, the app will create a new database from scratch.
  5. Run "Check bot", which call the Botometer Rapid API to check for bots in the database. It will not re-check the followers unless the bot data is expired. A download link will be available at the bottom of the sidebar when the process is completed. Alternatively, you can click the "Download bot check results" button to get the download link.

Results

Please check this section for the details of the output from bot check. You may also find this blog post and this paper from the developer of Botometer useful.

About

A Streamlit app that retrieves all the followers of a Twitter account and use Botometer API to check for bots.

Resources

Stars

Watchers

Forks

Languages