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

rule to weigh user activity in two subreddits #111

Closed
wchristian opened this issue Oct 3, 2022 · 5 comments
Closed

rule to weigh user activity in two subreddits #111

wchristian opened this issue Oct 3, 2022 · 5 comments

Comments

@wchristian
Copy link
Contributor

This is maybe a feature request or maybe me failing to use the facilities well.

We're dealing with brigading, and would like to use the bot to curtail brigading. Currently the most effective filtering would be if we could set up a rule that triggers on:

if (
    $post_count_our_reddit > 1
    and $post_count_brigader_reddit > 1
    and ( $post_count_our_reddit + $post_count_brigader_reddit ) > $activity_threshold
    and ( $post_count_brigader_reddit / $post_count_our_reddit ) > 0.8
)

Is this possible?

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 3, 2022

CM can do almost all of this! Here's as close to verbatim using the Recent Activity and History rules:

runs:
    - checks:
          - name: Brigade Check
            kind: comment
            # all rules must trigger to trigger the whole Check
            condition: AND
            rules:
                # triggers if user has ANY activities (submissions/comments) in your subreddit
                - name: hasOurSubHistory
                  kind: recentActivity
                  # number of activities to check from user's history
                  window: 100
                  thresholds:
                      - subreddits: # list of subreddits to count from user's history
                            - "mySubreddit"
                        threshold: "> 0" # number of activities that trigger the rule

                # triggers if user has ANY activities (submissions/comments) in brigading subreddit
                - name: hasBrigadingSubHistory
                  kind: recentActivity
                  window: 100
                  thresholds:
                      - subreddits:
                            - "brigadingSubreddit"
                        threshold: "> 0"

                # triggers if user has $activity_threshold number of activities (submissions/comments) in both subreddit
                - name: activityThreshold
                  kind: recentActivity
                  window: 100
                  thresholds:
                      - subreddits:
                            - "mySubreddit"
                            - "brigadingSubreddit"
                        # $activity_threshold
                        threshold: ">  5"

                # not 1-to-1 with what you want...
                # this will check that, of the last 100 activities in user's history, 80% of them occurred in r/brigadingSubreddit
                - name: ratio
                  kind: history
                  include:
                      - "brigadingSubreddit"
                  criteria:
                      - total: "> 80%"
                        window: 100

            actions:
                - kind: remove

@wchristian
Copy link
Contributor Author

Thanks for the reply, and yeah, that's mostly what i had in mind but that last part would really drown out the signal with the brigaders we're seeing, because it's many accounts with low and inconsistent activity who post a bunch on brigader reddit, but not overwhelmingly so, and come over to ours to drop 1 or 2 posts.

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 3, 2022

Understood. I've opened up a new issue for comparing ratios and will look into implementing it! Would be a very useful tool.

@wchristian
Copy link
Contributor Author

image

Thanks so much. :)

@wchristian
Copy link
Contributor Author

And i guess since #112 is there, this can be closed. :)

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

2 participants