0xfuturistic / Twitter-Giveaways-Bot

A bot that will constantly look for new giveaways and contests on Twitter; and enter to all of them! It will do whatever it's needed, either retweeting or liking something, or even following and DMing someone :D
MIT License
122 stars 41 forks source link

Ignore adult tweets [Solved]! #15

Closed ItsOmarKhater closed 3 years ago

ItsOmarKhater commented 3 years ago

It works perfectly!

I'd really appreciate it if you could add a function that skips inappropriate tweets, like those include "nudes", "sex" etc. Because the bot keeps retweeting those kinds of tweets. Thanks a lot for your great work!

Update: I did it myself! it turned out to be pretty easy :)

  1. in main.py scroll down to find this line for tweet in searched_tweets: and just paste this line below it: if not any(y in tweet.text.lower().split() for y in config.skip_retweet_tags): make sure to add indentation before and after the above line.

  2. in config.py before the retweet_tags list add this list skip_retweet_tags = ["nude", "nudes" ,"tits" ,"booty" ,"boobs", "cum"] you can add any more words you want the bot to ignore.

MisterWapak commented 3 years ago

Duuuuude, thank you so much ! Do you know how we can also add a: if tweet have less than "x" RT, then don't retweet ?

ItsOmarKhater commented 3 years ago

Duuuuude, thank you so much ! Do you know how we can also add a: if tweet have less than "x" RT, then don't retweet ?

Thanks for the inspiration! that would be useful to help ignore fake giveaways!

Here you are: in main.py scroll down to find this line for tweet in searched_tweets: and just paste this line below it: if tweet.retweet_count>5: make sure to add indentation before and after the above line.

in this case, the bot will only retweet if the tweet has more than 5 retweets.

MisterWapak commented 3 years ago

Amazing ! I'm not really good with python, I don't really know how Im suppose to do the indentation. Can you show me a screenshot of the code or can you write it down here ? Thank you a lot for the help :)

ItsOmarKhater commented 3 years ago

Amazing ! I'm not really good with python, I don't really know how Im suppose to do the indentation. Can you show me a screenshot of the code or can you write it down here ? Thank you a lot for the help :)

indentation means just press "tab" on your keyboard after the if statement for example: if you write this

if tweet.retweet_count>5:
if not any(y in tweet.text.lower().split() for y in config.skip_retweet_tags):

the code wont work. instead you just shift the code after the first line by pressing "tab" like this:

if tweet.retweet_count>5:
      if not any(y in tweet.text.lower().split() for y in config.skip_retweet_tags):
MisterWapak commented 3 years ago

Thank you a lotfor your help !