Skip to content

Bot that tries to identify political bots that spread fake news and other related things

Notifications You must be signed in to change notification settings

brochj/bothunter

Repository files navigation

BotHunter 🤖

Bot that tries to identify political bots that spread fake news and other related things

See Twitter Account Here! 🤖 @BotRobotico

How it works?

  1. Verify if exists political terms on Trending Page.

  2. If so, the bot starts checking the latest tweets.

  3. For each tweet, the bot will check the user stats.

  4. If the user has these conditions:

    • The last 20 tweets are only retweets
    • The account has an average of 200+ tweets per day, during its existence.
  5. If both conditions are true, then the bot will tweet an alert. Saying that account is possibly a bot.


Warning example 🚨

Screenshot

# English 🇺🇸
"🚨 Alert! Possible BOT 🚨"
f"User @{username}"
f"Average {avg_tweets} Tweets/day during his {days} active account days."
f"Total account tweets: {user.tweets}"
f"Term parsed: {term}"

Examples of some supended accounts 🚫

Go to twitter 💀 Souza43419194

suspended-1 suspended-1-1

Go to twitter 💀 LuizSilveiraSil

suspended-2 suspended-2-1

See more supended accounts

Go to twitter 💀 MauroAlvesZL

suspended-3 suspended-3-1

Go to twitter 💀 LucianneDalsec1

suspended-4 suspended-4-1


How to run

1. Requirements

2. Dependencies

Setting up a virtual environment (strongly recommended)

In your terminal, go to the project folder (bothunter) and run the following commands:

Linux

python -m pip install --user virtualenv
python -m venv .venv
source .venv/bin/activate
Windows
python -m pip install --user virtualenv
python -m venv venv
.\venv\Scripts\activate.bat

Install all needed packages

pip install -r requirements.txt

3. Developer portal

Go to Developer Portal Dashboard

  1. Create an App/Project
  2. In App Permissions set it to Read and Write
  3. In Keys and Tokens generate Consumer Keys
  4. Create a credentials.py file in the project's root folder (or copy credentials_example.py then rename it)
bothunter/
  ├── bot_actions.py
  ├── bothunter.py
  ├── bot_identifier.py
  ├── credentials_example.py
  ├── credentials.py
  ...

Copy and paste the consumer keys into credentials.py

# credentials.py
BEARER_TOKEN = ""

CONSUMER_KEY = ""
CONSUMER_SECRET = ""

ACCESS_TOKEN = ""
ACCESS_TOKEN_SECRET = ""

4. Finally! 🚀

Run the command python bothunter.py

Now your bot is working 🤖

(.venv)  ~/pj/bothunter: python bothunter.py
########################################
Buscando Hashtags que contém um dos seguintes termos
['bolsonaro',
 'jairbolsonaro',
 'presidente',
 'doria',
 'lula',
 'moro',
 'Maia',
 'FlavioBolsonaro',
 'EduardoBolsonaro',
 'STF',
 'salles',
 'lira',
 'cpi']
Nenhuma Hashtag encontrada, ficarei procurando a cada 30 segundos
Nenhuma Hashtag encontrada, ficarei procurando a cada 30 segundos

📫 How to reach me

brochj@gmail.com

About

Bot that tries to identify political bots that spread fake news and other related things

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published