helpers

package
v0.0.0-...-9e3b84f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2025 License: Apache-2.0, MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 DedupeStrings

func DedupeStrings(in []string) []string

func ExtractBlobCIDsProfile

func ExtractBlobCIDsProfile(profile *appbsky.ActorProfile) []string

func ExtractHashtagsPost

func ExtractHashtagsPost(post *appbsky.FeedPost) []string

func ExtractPostBlobCIDsPost

func ExtractPostBlobCIDsPost(post *appbsky.FeedPost) []string

func ExtractTextTokensPost

func ExtractTextTokensPost(post *appbsky.FeedPost) []string

func ExtractTextTokensProfile

func ExtractTextTokensProfile(profile *appbsky.ActorProfile) []string

func ExtractTextURLs

func ExtractTextURLs(raw string) []string

func ExtractTextURLsProfile

func ExtractTextURLsProfile(profile *appbsky.ActorProfile) []string

func HashOfString

func HashOfString(s string) string

returns a fast, compact hash of a string

current implementation uses murmur3, default seed, and hex encoding

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 NormalizeHashtag

func NormalizeHashtag(raw string) string

func ParentOrRootIsFollower

func ParentOrRootIsFollower(c *automod.RecordContext, post *appbsky.FeedPost) bool

func PostMentionsAnyDid

func PostMentionsAnyDid(post *appbsky.FeedPost, dids []string) bool

func PostMentionsDid

func PostMentionsDid(post *appbsky.FeedPost, did string) bool

func PostParentOrRootIsAnyDid

func PostParentOrRootIsAnyDid(post *appbsky.FeedPost, dids []string) bool

func PostParentOrRootIsDid

func PostParentOrRootIsDid(post *appbsky.FeedPost, did string) bool

Types

type PostFacet

type PostFacet struct {
	Text string
	URL  *string
	DID  *string
	Tag  *string
}

func ExtractFacets

func ExtractFacets(post *appbsky.FeedPost) ([]PostFacet, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL