Documentation
¶
Index ¶
- func DownloadImage(imageURL string) (string, error)
- func FetchAndEngage(a Article, groqAPIKey string) string
- func Format(a Article) string
- func FormatHeadline(a Article) string
- func GenerateMemeImage(username, password, text0, text1 string) (string, error)
- func GenerateMemeImageWithGroq(groqAPIKey, username, password, text0, text1 string) (string, error)
- func GenerateMemePost(apiKey, headline string) (string, string, error)
- func GeneratePollinationsImage(groqAPIKey, tweetText string) (string, error)
- func GenerateSelfComment(apiKey, postText string) string
- func GenerateThread(apiKey, topic string) ([]string, error)
- func IsTextOnlyFormat(name string) bool
- type Article
- type RSSFeed
- type SeenStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadImage ¶ added in v0.3.0
DownloadImage downloads an image URL to a temp file and returns the local path. Returns ("", nil) if imageURL is empty. Caller is responsible for deleting the file.
func FetchAndEngage ¶ added in v0.5.0
FetchAndEngage fetches the article content and uses Groq to write an engaging tweet with a hook, key insight, and opinion. Falls back to FormatHeadline if the API key is empty or the request fails.
func Format ¶
Format builds a tweet string from an Article with link included, guaranteed <= 280 chars. Kept for backwards compatibility; prefer FormatHeadline + a link reply for better reach.
func FormatHeadline ¶ added in v0.4.0
Use this for the main tweet; post the link as a reply to avoid reach suppression.
func GenerateMemeImage ¶ added in v0.3.0
GenerateMemeImage creates a meme image for the given post text. Priority: Pollinations.ai (AI-generated) → memegen.link → Imgflip
func GenerateMemeImageWithGroq ¶ added in v0.6.0
GenerateMemeImageWithGroq creates an image using Pollinations (with Groq prompt generation), falling back to memegen.link then Imgflip.
func GenerateMemePost ¶ added in v0.3.0
GenerateMemePost generates an AI-powered tweet using Groq. Returns the post text and the format name used. headline is optional — used for reaction/news_reaction formats.
func GeneratePollinationsImage ¶ added in v0.6.0
GeneratePollinationsImage generates a contextually relevant AI image from a tweet text. It first uses Groq to craft a good image prompt, then hits Pollinations.ai to generate it. Returns a local temp file path. No API key or credits required.
func GenerateSelfComment ¶ added in v0.6.0
GenerateSelfComment generates a short follow-up comment to post on your own tweet. This seeds the reply chain and boosts engagement velocity.
func GenerateThread ¶ added in v0.4.0
GenerateThread generates a 5–8 tweet thread using Groq. topic is optional — if empty, Groq picks a relevant dev/tech topic. Returns a slice of tweet strings, each <= 280 chars.
func IsTextOnlyFormat ¶ added in v0.6.0
Types ¶
type Article ¶
type Article struct {
FeedName string
Category string
Title string
Link string
ImageURL string
Published time.Time
}
Article is a fetched news item ready to be tweeted
type RSSFeed ¶
type RSSFeed struct {
Name string `json:"name"`
URL string `json:"url"`
Category string `json:"category"`
}
RSSFeed represents a single feed source from rss_feeds.json
type SeenStore ¶
type SeenStore struct {
// contains filtered or unexported fields
}
SeenStore persists seen article hashes across restarts to prevent duplicates