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

Ignore adult tweets [Solved]! #15

Closed
ItsOmarKhater opened this issue Dec 19, 2020 · 5 comments
Closed

Ignore adult tweets [Solved]! #15

ItsOmarKhater opened this issue Dec 19, 2020 · 5 comments

Comments

@ItsOmarKhater
Copy link
Contributor

ItsOmarKhater commented Dec 19, 2020

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
Copy link

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 ItsOmarKhater changed the title Such a great work! Good job bro 👏👏 Ignore adult tweets [Solved]! Dec 19, 2020
@ItsOmarKhater
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

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
Copy link

Thank you a lotfor your help !

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

No branches or pull requests

3 participants