Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
/ bot-followers Public archive

šŸŠĀ Find out how many bots follow any given Twitter acount

License

Notifications You must be signed in to change notification settings

cuducos/bot-followers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 

History

90 Commits
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

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.

Installing

  1. Make sure you meet these requirements:
    1. Twitter API keys
    2. Botometer API key
    3. For development, Docker Compose
    4. For production, Dokku
  2. Set up your local configuration variables; you can:
    • run Createnv,
    • or manually copy .env.sample as .env editing it accordingly.

Development environment

To start the services use the default docker-compose up. To prevent errors in the development environment, make sure the you have DEBUG=True in your .env file.

Deploy environment

Having a Dokku-ready server:

  1. Install the following Dokku plug-ins:
    1. PostgreSQL (or other database of your choice)
    2. RabbitMQ (or other Celery broker of your choice)
    3. Let's Encrypt
  2. Create an app for Bot Followers in Dokku, add it as a remote repository in your local Git repository, and activate the plug-ins.
  3. For each variable in .env, 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 tests, run checks, and format your code with Black:

$ python manage.py test
$ black .