social

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package social provides extraction of social media information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlueSkyProfile

type BlueSkyProfile struct {
	Did            string   `json:"did"`
	Handle         string   `json:"handle"`
	DisplayName    string   `json:"displayName"`
	Description    string   `json:"description"`
	Avatar         string   `json:"avatar"`
	Banner         string   `json:"banner"`
	CreatedAt      string   `json:"createdAt"`
	Labels         []string `json:"labels"`
	FollowersCount int      `json:"followersCount"`
	FollowingCount int      `json:"followingCount"`
	PostsCount     int      `json:"postsCount"`
}

BlueSkyProfile represents a BlueSky profile from the API.

type Content

type Content struct {
	Fields   map[string]string
	Kind     string
	URL      string
	Bio      string
	Markdown string
	Location string
	Name     string
	Username string
	Joined   string
	Tags     []string
}

Content represents structured content extracted from a social media profile or website.

func Extract

func Extract(ctx context.Context, data map[string]string, logger *slog.Logger) []Content

Extract processes a map of social media URLs/data and returns structured content for each The map key is the type (e.g., "mastodon", "twitter", "website", "linkedin") The map value is the URL or identifier.

type MastodonAccount

type MastodonAccount struct {
	ID             string          `json:"id"`
	Username       string          `json:"username"`
	Acct           string          `json:"acct"`
	DisplayName    string          `json:"display_name"`
	Note           string          `json:"note"` // Bio in HTML
	URL            string          `json:"url"`  // Profile URL
	CreatedAt      time.Time       `json:"created_at"`
	Fields         []MastodonField `json:"fields"` // Custom profile fields
	FollowersCount int             `json:"followers_count"`
	FollowingCount int             `json:"following_count"`
	StatusesCount  int             `json:"statuses_count"`
}

MastodonAccount represents the API response from Mastodon.

type MastodonField

type MastodonField struct {
	VerifiedAt *time.Time `json:"verified_at,omitempty"`
	Name       string     `json:"name"`
	Value      string     `json:"value"`
}

MastodonField represents a custom field on a Mastodon profile.

type MastodonProfileData

type MastodonProfileData struct {
	ProfileFields map[string]string
	Username      string
	DisplayName   string
	Bio           string
	JoinedDate    string
	Websites      []string
	Hashtags      []string
}

MastodonProfileData represents all extracted data from a Mastodon profile.

Jump to

Keyboard shortcuts

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