Documentation ¶
Overview ¶
Example automod rules and helpers.
Index ¶
- func AccountDemoPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func AccountIsOlderThan(c *automod.AccountContext, age time.Duration) bool
- func AccountIsYoungerThan(c *automod.AccountContext, age time.Duration) bool
- func AccountPrivateDemoPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func AggressivePromotionRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func BadHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func BadWordDIDRule(c *automod.AccountContext) error
- func BadWordHandleRule(c *automod.AccountContext) error
- func BadWordOtherRecordRule(c *automod.RecordContext) error
- func BadWordPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func BadWordProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
- func BadWordRecordKeyRule(c *automod.RecordContext) error
- func BlobVerifyRule(c *automod.RecordContext, blob lexutil.LexBlob, data []byte) error
- func BotLinkProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
- func CelebSpamIdentityRule(c *automod.AccountContext) error
- func CelebSpamProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
- func DefaultRules() automod.RuleSet
- func DeleteInteractionRule(c *automod.RecordContext) error
- func DistinctMentionsRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func ExtractBlobCIDsProfile(profile *appbsky.ActorProfile) []string
- func ExtractHashtagsPost(post *appbsky.FeedPost) []string
- func ExtractPostBlobCIDsPost(post *appbsky.FeedPost) []string
- func ExtractTextTokensPost(post *appbsky.FeedPost) []string
- func ExtractTextTokensProfile(profile *appbsky.ActorProfile) []string
- func ExtractTextURLs(raw string) []string
- func ExtractTextURLsProfile(profile *appbsky.ActorProfile) []string
- func GtubePostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func GtubeProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
- func HarassmentProtectionOzoneEventRule(c *automod.OzoneEventContext) error
- func HarassmentTargetInteractionPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func HarassmentTrivialPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func HashOfString(s string) string
- func IdenticalReplyPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func IdenticalReplyPostSameParentRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func InteractionChurnRule(c *automod.RecordContext) error
- func IsSelfThread(c *automod.RecordContext, post *appbsky.FeedPost) bool
- func MisleadingLinkUnicodeReversalPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func MisleadingMentionPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func MisleadingURLPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func NewAccountBotEmailRule(c *automod.AccountContext) error
- func NewAccountRule(c *automod.AccountContext) error
- func NormalizeHashtag(raw string) string
- func NostrSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func ParentOrRootIsFollower(c *automod.RecordContext, post *appbsky.FeedPost) bool
- func ReplyCountPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func ReplySingleBadWordPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func SimpleBotPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func TooManyHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func TooManyRepostRule(c *automod.RecordContext) error
- func TrivialSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func YoungAccountDistinctMentionsRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- func YoungAccountDistinctRepliesRule(c *automod.RecordContext, post *appbsky.FeedPost) error
- type PostFacet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountDemoPostRule ¶
func AccountDemoPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
this is a dummy rule to demonstrate accessing account metadata (eg, profile) from within post handler
func AccountIsOlderThan ¶
func AccountIsOlderThan(c *automod.AccountContext, age time.Duration) bool
checks if account was *not* created recently, based on either public or private account metadata. if metadata isn't available at all, or seems bogus, returns 'false'
func AccountIsYoungerThan ¶
func AccountIsYoungerThan(c *automod.AccountContext, age time.Duration) bool
checks if account was created recently, based on either public or private account metadata. if metadata isn't available at all, or seems bogus, returns 'false'
func AccountPrivateDemoPostRule ¶
func AccountPrivateDemoPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
dummy rule. this leaks PII (account email) in logs and should never be used in real life
func AggressivePromotionRule ¶
func AggressivePromotionRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for new accounts, with a commercial or donation link in profile, which directly reply to several accounts
this rule depends on ReplyCountPostRule() to set counts
func BadHashtagsPostRule ¶
func BadHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for specific hashtags from known lists
func BadWordDIDRule ¶
func BadWordDIDRule(c *automod.AccountContext) error
func BadWordHandleRule ¶
func BadWordHandleRule(c *automod.AccountContext) error
func BadWordOtherRecordRule ¶
func BadWordOtherRecordRule(c *automod.RecordContext) error
scans for bad keywords in records other than posts and profiles
func BadWordPostRule ¶
func BadWordPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func BadWordProfileRule ¶
func BadWordProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
func BadWordRecordKeyRule ¶
func BadWordRecordKeyRule(c *automod.RecordContext) error
scans the record-key for all records
func BlobVerifyRule ¶
func BotLinkProfileRule ¶
func BotLinkProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
func CelebSpamIdentityRule ¶
func CelebSpamIdentityRule(c *automod.AccountContext) error
func CelebSpamProfileRule ¶
func CelebSpamProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
func DefaultRules ¶
IMPORTANT: reminder that these are the indigo-edition rules, not production rules
func DeleteInteractionRule ¶
func DeleteInteractionRule(c *automod.RecordContext) error
func DistinctMentionsRule ¶
func DistinctMentionsRule(c *automod.RecordContext, post *appbsky.FeedPost) error
DistinctMentionsRule looks for accounts which mention an unusually large number of distinct accounts per period.
func ExtractBlobCIDsProfile ¶
func ExtractBlobCIDsProfile(profile *appbsky.ActorProfile) []string
func ExtractHashtagsPost ¶
func ExtractPostBlobCIDsPost ¶
func ExtractTextTokensPost ¶
func ExtractTextTokensProfile ¶
func ExtractTextTokensProfile(profile *appbsky.ActorProfile) []string
func ExtractTextURLs ¶
func ExtractTextURLsProfile ¶
func ExtractTextURLsProfile(profile *appbsky.ActorProfile) []string
func GtubePostRule ¶
func GtubePostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func GtubeProfileRule ¶
func GtubeProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error
func HarassmentProtectionOzoneEventRule ¶
func HarassmentProtectionOzoneEventRule(c *automod.OzoneEventContext) error
looks for new harassment protection tags on accounts, and logs them
func HarassmentTargetInteractionPostRule ¶
func HarassmentTargetInteractionPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for new accounts, which interact with frequently-harassed accounts, and report them for review
func HarassmentTrivialPostRule ¶
func HarassmentTrivialPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for new accounts, which frequently post the same type of content
func HashOfString ¶
returns a fast, compact hash of a string
current implementation uses murmur3, default seed, and hex encoding
func IdenticalReplyPostRule ¶
func IdenticalReplyPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
Looks for accounts posting the exact same text multiple times. Does not currently count the number of distinct accounts replied to, just counts replies at all.
There can be legitimate situations that trigger this rule, so in most situations should be a "report" not "label" action.
func IdenticalReplyPostSameParentRule ¶
func IdenticalReplyPostSameParentRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func InteractionChurnRule ¶
func InteractionChurnRule(c *automod.RecordContext) error
looks for accounts which do frequent interaction churn, such as follow-unfollow.
func IsSelfThread ¶
func IsSelfThread(c *automod.RecordContext, post *appbsky.FeedPost) bool
checks if the post event is a reply post for which the author is replying to themselves, or author is the root author (OP)
func MisleadingLinkUnicodeReversalPostRule ¶
func MisleadingLinkUnicodeReversalPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func MisleadingMentionPostRule ¶
func MisleadingMentionPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func MisleadingURLPostRule ¶
func MisleadingURLPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func NewAccountBotEmailRule ¶
func NewAccountBotEmailRule(c *automod.AccountContext) error
func NewAccountRule ¶
func NewAccountRule(c *automod.AccountContext) error
triggers on first identity event for an account (DID)
func NormalizeHashtag ¶
func NostrSpamPostRule ¶
func NostrSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for new accounts, which frequently post the same type of content
func ParentOrRootIsFollower ¶
func ParentOrRootIsFollower(c *automod.RecordContext, post *appbsky.FeedPost) bool
func ReplyCountPostRule ¶
func ReplyCountPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
does not count "self-replies" (direct to self, or in own post thread)
func ReplySingleBadWordPostRule ¶
func ReplySingleBadWordPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for the specific harassment situation of a replay to another user with only a single word
func SimpleBotPostRule ¶
func SimpleBotPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func TooManyHashtagsPostRule ¶
func TooManyHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
if a post is "almost all" hashtags, it might be a form of search spam
func TooManyRepostRule ¶
func TooManyRepostRule(c *automod.RecordContext) error
looks for accounts which do frequent reposts
func TrivialSpamPostRule ¶
func TrivialSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
looks for new accounts, which frequently post the same type of content
func YoungAccountDistinctMentionsRule ¶
func YoungAccountDistinctMentionsRule(c *automod.RecordContext, post *appbsky.FeedPost) error
func YoungAccountDistinctRepliesRule ¶
func YoungAccountDistinctRepliesRule(c *automod.RecordContext, post *appbsky.FeedPost) error