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

filter tunning #17

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions ethicsBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,43 @@ def on_status(self, status):

# Non Desired Terms
if(
status.full_text.find("$") != -1 or
status.full_text.find("deal") != -1 or
status.full_text.find("Deal") != -1 or
status.full_text.find("promotion") != -1 or
status.full_text.find("Promotion") != -1 or
status.full_text.find("download") != -1 or
status.full_text.find("Download") != -1 or
status.full_text.find("sale") != -1 or
status.full_text.find("Sale") != -1 or
status.full_text.find("homework") != -1 or
status.full_text.find("#coding") != -1 or
status.full_text.find("#soulecting") != -1 or
status.user.screen_name == ("mediaethicsbot") or # Reason: profile that post random content
status.full_text.find("$") != -1 or
status.full_text.find("100%") != -1 or
status.full_text.find("deal") != -1 or
status.full_text.find("Deal") != -1 or
status.full_text.find("promotion") != -1 or
status.full_text.find("Promotion") != -1 or
status.full_text.find("download") != -1 or
status.full_text.find("Download") != -1 or
status.full_text.find("product") != -1 or
status.full_text.find("Product") != -1 or
status.full_text.find("sale") != -1 or
status.full_text.find("Sale") != -1 or
status.full_text.find("client") != -1 or
status.full_text.find("Client") != -1 or
status.full_text.find("costumer") != -1 or
status.full_text.find("Costumer") != -1 or
status.full_text.find("homework") != -1 or
status.full_text.find("Homework") != -1 or
status.full_text.find("RT") != -1 or
status.full_text.find("#TransparencyARC") != -1 or
status.full_text.find("#100DaysOfCode") != -1 or
status.full_text.find("#coding") != -1 or
status.full_text.find("#soulecting") != -1 or
status.user.screen_name == ("mediaethicsbot") or # Reason: profile that post random content
status.full_text == self.last_tweet
):
return

translated_tweet = GoogleTranslator(source='auto', target='pt').translate(status.full_text)

# Non Desired Terms
if(
translated_tweet.find("comissão de ética") != -1 or
translated_tweet.find("vaga") != -1
):
return

# Related Terms
if (
translated_tweet.find("ciber") != -1 or
Expand Down Expand Up @@ -127,6 +145,7 @@ def on_status(self, status):
# print(status.full_text)

translated_tweet = translated_tweet.replace("&", "&")
translated_tweet = translated_tweet.replace("&lt;", "<")
translated_tweet = translated_tweet.replace("&gt;", ">")

if(translated_tweet == status.full_text):
Expand Down