Skip to content

flcavqueiroz/bot-followers

 
 

Repository files navigation

Bot Followers GitHub Actions: Tests GitHub Actions: Black

A web app to check whether followers of a given Twitter account are bots using Botometer. This repository started as a fork of Twitter Clean-up.

Dashboard

If you're looking for the CLI version, it's tagged.

Requirements

Development setup

Copy .env.sample as .env and fill the environment values as appropriated. I tried to use meaningful variables names, but fell free to ask if anything is not clear.

To start the services use the default docker-compose up.

Deploy setup

Having a Dokku-ready server, install the following Dokku plug-ins:

Create an app for Bot Followers in Dokku, add it as a remote repository in your local Git repository, and activate the plug-ins.

For each variable in .env.sample, create an equivalent environment variable for your Dokku app.

Usage

The commands in this section might be prefixed by:

  • docker-compose run --rm django in development mode
  • dokku run <app name> in production mode

Dashboard

In order to get the app ready, before visiting / at your server, you need to run migrations and create a user(s) to access the dashboard.

  1. Run migrations with python manage.py migrate
  2. Create a super user for yourself with python manage.py createsuperuser

It's recommended to create a proper user to access the dashboard without super powers: all you need to do is to:

  1. Login in as superuser create a new user that is staff
  2. Get back to the edit page of this user
  3. In the Permissions menu, add only the permission to view report to this new user

API

There is a simple JSON API at /api/ to share the report data without the need of user or login.

Management commands

Importing data from the CLI version

$ python manage.py import /path/to/borsalino.sqlite3

Check whether active/inactive jobs are in sync in the dashboard

$ python manage.py updatecelerytasks

Empty the queue of pending tasks

$ python manage.py purgecelerytasks

Contributing

Please, write and run tests, and format your code with Black:

$ black .
$ python manage.py test

About

🍊 Find out how many bots follow any given Twitter acount

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 81.4%
  • HTML 17.7%
  • Dockerfile 0.9%