-
Notifications
You must be signed in to change notification settings - Fork 6
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
cardoso42
wants to merge
14
commits into
Pegabots:main
Choose a base branch
from
cardoso42:BotBlock
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
BotBlock #6
+277
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Lucas Cardoso <[email protected]>
Signed-off-by: Lucas Cardoso <[email protected]>
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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.