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

Implement comparison of activity in one set of subreddits against another set of subreddits #112

Closed
FoxxMD opened this issue Oct 3, 2022 · 2 comments
Labels
enhancement New feature or request Rule Pertaining to CM rules

Comments

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 3, 2022

#111

In order to determine ratio of activity between two subreddit(s), specifically, rather than against total user activity (history) or in just on set of subreddits (history/recent). This seems like a pretty useful, general tool.

First impression is it should be done using the History rule but need to investigate possible alternatives.

@FoxxMD FoxxMD added enhancement New feature or request Rule Pertaining to CM rules labels Oct 3, 2022
@FoxxMD
Copy link
Owner Author

FoxxMD commented Oct 3, 2022

@wchristian I've got a preliminary implementation done in edge branch if you want to try it out. Here's some quick docs on it. And here's how it would be used with the config:

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"

          # in the user's last 100 activities...
          # there are equal to or more than 0.8 activities in brigradingSubreddit per 1 activity in mySubreddit
          - kind: history
            criteria:
              - window:
                  count: 100
                  # uncomment and set to submission or comment to restrict the type of activities retrieved from user history
                  # defaults to "overview" IE retrieve both submissions/comments
                  #fetch: submission 
                  filterOn:
                    post:
                      subreddits:
                        include:
                          - brigadingSubreddit
                ratio:
                  window:
                    count: 100
                    # uncomment and set to submission or comment to restrict the type of activities retrieved from user history
                    # defaults to "overview" IE retrieve both submissions/comments
                    #fetch: submission 
                    filterOn:
                      post:
                        subreddits:
                          include:
                            - mySubreddit
                  # the ratio to use -- is defined by (number of activities from "parent" criteria window) / (number of activities from "ratio" window)
                  threshold: '>= 0.8'


        actions:
          - kind: remove

@FoxxMD
Copy link
Owner Author

FoxxMD commented Oct 5, 2022

Added in 0.13.1

@FoxxMD FoxxMD closed this as completed Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Rule Pertaining to CM rules
Projects
None yet
Development

No branches or pull requests

1 participant