Skip to content

Commit

Permalink
simplify build following rule
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Sep 5, 2024
1 parent a50845f commit f9079ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions automod/rules/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

var interactionDailyThreshold = 800
var followsDailyThreshold = 3000

var _ automod.RecordRuleFunc = InteractionChurnRule

Expand All @@ -26,6 +27,7 @@ func InteractionChurnRule(c *automod.RecordContext) error {
c.AddAccountFlag("high-like-churn")
c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("interaction churn: %d likes, %d unlikes today (so far)", created, deleted))
c.Notify("slack")
return nil
}
case "app.bsky.graph.follow":
c.Increment("follow", did)
Expand All @@ -37,14 +39,16 @@ func InteractionChurnRule(c *automod.RecordContext) error {
c.AddAccountFlag("high-follow-churn")
c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("interaction churn: %d follows, %d unfollows today (so far)", created, deleted))
c.Notify("slack")
return nil
}
// just generic bulk following
followRatio := float64(c.Account.FollowersCount) / float64(c.Account.FollowsCount)

Check failure on line 45 in automod/rules/interaction.go

View workflow job for this annotation

GitHub Actions / lint

followRatio declared and not used

Check failure on line 45 in automod/rules/interaction.go

View workflow job for this annotation

GitHub Actions / build-and-test

followRatio declared and not used
if created > interactionDailyThreshold && c.Account.FollowsCount > 2000 && followRatio < 0.2 {
if created > followsDailyThreshold {
c.Logger.Info("bulk-follower", "created-today", created)
c.AddAccountFlag("bulk-follower")
c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("bulk following: %d follows today (so far)", created))
//c.Notify("slack")
c.Notify("slack")
return nil
}
}
return nil
Expand Down

0 comments on commit f9079ad

Please sign in to comment.