Documentation
¶
Overview ¶
Package entry defines the core feed entry types for Signal output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discussion ¶
type Discussion struct {
Platform string `json:"platform"` // "hackernews", "reddit", "lobsters", etc.
URL string `json:"url"` // Full URL to the discussion
ID string `json:"id,omitempty"` // Platform-specific ID (e.g., HN item ID)
Score int `json:"score,omitempty"` // Upvotes/points at time of capture
Comments int `json:"comments,omitempty"` // Comment count at time of capture
}
Discussion represents a link to a discussion forum.
type Entry ¶
type Entry struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
Author string `json:"author,omitempty"`
Date time.Time `json:"date"`
Feed FeedMeta `json:"feed"`
Tags []string `json:"tags,omitempty"`
Summary string `json:"summary,omitempty"`
Content string `json:"content,omitempty"`
Image string `json:"image,omitempty"` // Main image URL
ImageAlt string `json:"imageAlt,omitempty"` // Alt text for image
Source *Source `json:"source,omitempty"` // Platform source metadata
IsPriority bool `json:"isPriority,omitempty"` // Hand-curated priority link
PriorityRank int `json:"priorityRank,omitempty"` // Ordering for priority links
Discussions []Discussion `json:"discussions,omitempty"` // Links to discussions (HN, Reddit, etc.)
}
Entry represents a single feed entry in the aggregated output.
type Feed ¶
type Feed struct {
Generated time.Time `json:"generated"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
HomeURL string `json:"homeUrl,omitempty"`
Entries []Entry `json:"entries"`
}
Feed represents the complete aggregated feed output.
func (*Feed) Deduplicate ¶
func (f *Feed) Deduplicate()
Deduplicate removes duplicate entries based on URL. When duplicates are found, it merges discussions and prefers priority entries.
func (*Feed) FilterByTags ¶
FilterByTags returns entries that match any of the given tags.
func (*Feed) SortByDate ¶
func (f *Feed) SortByDate()
SortByDate sorts entries by date, newest first.
func (*Feed) ToJSONFeed ¶
ToJSONFeed converts the internal Feed to a JSON Feed 1.1 format.
func (*Feed) WriteJSONFeed ¶
WriteJSONFeed writes the feed in JSON Feed 1.1 format.
type FeedMeta ¶
type FeedMeta struct {
Title string `json:"title"`
URL string `json:"url"`
IconURL string `json:"iconUrl,omitempty"`
}
FeedMeta contains metadata about the source feed.
type Source ¶
type Source struct {
Platform string `json:"platform"` // "linkedin", "twitter", "mastodon", etc.
Author string `json:"author,omitempty"` // Platform-specific author name/handle
PostID string `json:"postId,omitempty"` // Platform-specific post ID
}
Source represents metadata about the content source platform.