Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BotBlock #6

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

BotBlock #6

wants to merge 14 commits into from

Conversation

cardoso42
Copy link

BotBlock

Equipe

Guilherme Branco Peres Salami
Heitor de Paiva Boccato
Lucas Cardoso dos Santos

Ideia do Projeto

Desafio: A fim de ampliar as formas de analisar usuários do Twitter e as funcionalidades associadas à ferramenta Pegabot, vislumbramos como oportunidade o desenvolvimento de uma extensão para navegadores (exemplo: Google Chrome e Firefox).

Execução

A extensão desenvolvida por nós tem o objetivo de reduzir os efeitos de desinformação propagadas por bots. Com o funcionamento parecido com o AdBlocker, ela oculta os tweets vindos de contas já identificadas como prováveis bots. Essa filtragem poderá ser feita com um incremento na API do PegaBot, retornando os nomes de usuários identificados.
Porém, como todo processo está suscetível a erros, também implementamos uma opção, com o botão direito do mouse, de pedir uma análise à API do PegaBot para identificar se o perfil selecionado é um bot ou não.

Planos para o futuro

Expansão da API

Uma parte essencial para o funcionamento em larga escala da extensão é uma porta na API que retorne ao usuário os bots conhecidos. Isso não existe ainda, mas imaginamos que possa ser facilmente implementado. O único motivo pelo qual não fizemos ainda foi pelo tempo durante o Hackathon.

Régua da probabilidade de bot

A definição se um perfil é um bot não é binária. O valor calculado é um número real entre 0 e 1. Convertemos esse resultado em um valor booleano, considerando um valor divisor de 0.7, como aconselhado pelos mentores durante a Hackathon. Porém seria interessante passar esse controle ao usuário, permitindo que ele defina qual valor é esse.

Expansão de navegadores

O nosso trabalho se focou no Google Chrome, pelo motivo de ser o navegador mais utilizado, mas nada impede que esse trabalho seja expandido para outros navegadores.

heitorboccatousp and others added 14 commits September 4, 2022 16:18
This is the time expensive way to verify bot. It simply calls the
PegaBot's API and verify if the probability to be a bot is over 70%.

It will be used to let user click and verify if a profile on Twitter is
a bot or not, not to filter the posts.

Signed-off-by: Lucas Cardoso <[email protected]>
Create function that searches for the user handle in every tweet and
removes this tweet if it is in an array of known bots (achieved
futurally from the API)

Signed-off-by: Lucas Cardoso <[email protected]>
The use of DOMNodeInsert was deprecated, so it was changed to the
official documentation suggestion: MutationObserver.

Signed-off-by: Lucas Cardoso <[email protected]>
There was some occurences where some tweets by people inside the bots
array were not being removed.

After some effort trying to find the cause, it was determined that this
was happening because of the forEach loop inside the tweet, where if
there was any result after the bot, it was overwritten, leaving the
final result as false.

The bug fix was done by creating a flag that marks if at any moment
a bot was found, in this case, the entire tweet is removed.

Signed-off-by: Lucas Cardoso <[email protected]>
Document functions that were still undocumented.

Signed-off-by: Lucas Cardoso <[email protected]>
Tools file will have all useful functions that can be shared to another
files. Since services can't be modules and therefore can't import
exported functions, this will not have the export keyword also.

To import its functions, it will be needed to use the importScripts
function.

Signed-off-by: Lucas Cardoso <[email protected]>
Create a new context menu on every link the user right clicks on. It
allows to verify, if it is a twitter profile, if the profile is a bot.

Signed-off-by: Lucas Cardoso <[email protected]>
Signed-off-by: Lucas Cardoso <[email protected]>
Co-authored-by: Heitor Boccato <[email protected]>
Script now will only run on Twitter, also creates a description, changes
the name and set the version to 0.0.1

Signed-off-by: Lucas Cardoso <[email protected]>
In the purpose to help anyone who wants to read this code, create
documentation to all functions in background.js file, also remove
unwanted commented code on script.js

Signed-off-by: Lucas Cardoso <[email protected]>
The project had been developed in a private repository so far, so it was
structured without thinking about other files in the main folder, like
CODE_OF_CONDUCT and CONTRIBUTING.

To make the files easier to understand, create a new folder 'BotBlock'
and move all our work to there.

Signed-off-by: Lucas Cardoso <[email protected]>
@itsrioadmin itsrioadmin linked an issue Sep 13, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extensão do Pegabot para navegadores
2 participants