5
netikras
168d

I think it's time to make a devrant bot automatically downvoting spam posts and spin it as 2 instances. Any takers? :)

fight automatism with automatism

robot fights of 2024 😁

Comments
  • 2
    Here is a suggestion for the implementation:

    let blacklist = ["recovery", "hacker", "cryptocurrency"]

    func downvote(post: String) -> Bool {
    for entry in blacklist {
    if post.caseInsensitiveContains(entry) {
    return true
    }
    }
    return false
    }
  • 1
    @Lensflare just use regex at this point
  • 1
    And in a more sane language than swift, look at this abomination 🤢
    if string.range(of: regex, options: .regularExpression, range: nil, locale: nil) != nil ...

    superior js: if (regex.test(string))
  • 1
    @devRancid this is obviously designed so that you can also check where it matches (not only if it matches)

    You can easily make an extension which will look and behave just as the js one.

    But if you want to do it the other way around and make js do what swift does… good luck, pal.

    People desperately trying to make js look good are hilarious.
  • 0
    Only if the bot is named RockEmSockEm.
Add Comment