this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

yet more rule tweaks (#745)

authored by

bnewbold and committed by
GitHub
5f33e2cc 2462d586

+40 -5
+1
automod/rules/all.go
··· 28 28 HarassmentTargetInteractionPostRule, 29 29 HarassmentTrivialPostRule, 30 30 NostrSpamPostRule, 31 + TrivialSpamPostRule, 31 32 }, 32 33 ProfileRules: []automod.ProfileRuleFunc{ 33 34 GtubeProfileRule,
+6 -3
automod/rules/interaction.go
··· 8 8 ) 9 9 10 10 var interactionDailyThreshold = 800 11 + var followsDailyThreshold = 3000 11 12 12 13 var _ automod.RecordRuleFunc = InteractionChurnRule 13 14 ··· 26 27 c.AddAccountFlag("high-like-churn") 27 28 c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("interaction churn: %d likes, %d unlikes today (so far)", created, deleted)) 28 29 c.Notify("slack") 30 + return nil 29 31 } 30 32 case "app.bsky.graph.follow": 31 33 c.Increment("follow", did) ··· 37 39 c.AddAccountFlag("high-follow-churn") 38 40 c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("interaction churn: %d follows, %d unfollows today (so far)", created, deleted)) 39 41 c.Notify("slack") 42 + return nil 40 43 } 41 44 // just generic bulk following 42 - followRatio := float64(c.Account.FollowersCount) / float64(c.Account.FollowsCount) 43 - if created > interactionDailyThreshold && c.Account.FollowsCount > 2000 && followRatio < 0.2 { 45 + if created > followsDailyThreshold { 44 46 c.Logger.Info("bulk-follower", "created-today", created) 45 47 c.AddAccountFlag("bulk-follower") 46 48 c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("bulk following: %d follows today (so far)", created)) 47 - //c.Notify("slack") 49 + c.Notify("slack") 50 + return nil 48 51 } 49 52 } 50 53 return nil
+25
automod/rules/quick.go
··· 68 68 } 69 69 return nil 70 70 } 71 + 72 + var _ automod.PostRuleFunc = TrivialSpamPostRule 73 + 74 + // looks for new accounts, which frequently post the same type of content 75 + func TrivialSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error { 76 + if c.Account.Identity == nil || !AccountIsYoungerThan(&c.AccountContext, 8*24*time.Hour) { 77 + return nil 78 + } 79 + 80 + // only posts with dumb patterns (for now) 81 + txt := strings.ToLower(post.Text) 82 + if !c.InSet("trivial-spam-text", txt) { 83 + return nil 84 + } 85 + 86 + // only accounts with empty profile (for now) 87 + if c.Account.Profile.HasAvatar { 88 + return nil 89 + } 90 + 91 + c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("trivial spam account (also labeled; remove label if this isn't spam!)")) 92 + c.AddAccountLabel("!hide") 93 + c.Notify("slack") 94 + return nil 95 + }
+8 -2
automod/rules/replies.go
··· 39 39 // var identicalReplyLimit = 6 40 40 // TODO: bumping temporarily 41 41 var identicalReplyLimit = 20 42 + var identicalReplyActionLimit = 75 42 43 43 44 var _ automod.PostRuleFunc = IdenticalReplyPostRule 44 45 ··· 71 72 count := c.GetCount("reply-text", bucket, period) 72 73 if count >= identicalReplyLimit { 73 74 c.AddAccountFlag("multi-identical-reply") 74 - c.ReportAccount(automod.ReportReasonRude, fmt.Sprintf("possible spam (new account, %d identical reply-posts today)", count)) 75 + c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("possible spam (new account, %d identical reply-posts today)", count)) 76 + c.Notify("slack") 77 + } 78 + if count >= identicalReplyActionLimit && utf8.RuneCountInString(post.Text) > 100 { 79 + c.ReportAccount(automod.ReportReasonRude, fmt.Sprintf("likely spam/harassment (new account, %d identical reply-posts today), actioned (remove label urgently if account is ok)", count)) 80 + c.AddAccountLabel("!warn") 75 81 c.Notify("slack") 76 82 } 77 83 ··· 115 121 116 122 // TODO: bumping temporarily 117 123 // var youngReplyAccountLimit = 12 118 - var youngReplyAccountLimit = 30 124 + var youngReplyAccountLimit = 200 119 125 var _ automod.PostRuleFunc = YoungAccountDistinctRepliesRule 120 126 121 127 func YoungAccountDistinctRepliesRule(c *automod.RecordContext, post *appbsky.FeedPost) error {