Fix archive cmd panic on short content (#9) #34

Merged
Claude merged 1 commits from fix/archive-cmd-short-content into main 2026-02-15 16:18:46 +00:00
Showing only changes of commit b4e462a6b4 - Show all commits

View File

@@ -106,6 +106,15 @@ func main() {
return err
}
content := ""
if article.Content != "" {
if len(article.Content) > 32 {
content = article.Content[:32] + "..."
} else {
content = article.Content
}
}
fmt.Println("Title:", article.Title)
fmt.Println("Byline:", article.Byline)
fmt.Println("Site:", article.SiteName)
@@ -113,7 +122,7 @@ func main() {
fmt.Println("Excerpt:", article.Excerpt)
fmt.Println("Length:", article.Length)
fmt.Println("Lang:", article.Lang)
fmt.Println("Content:", article.Content[:32]+"...")
fmt.Println("Content:", content)
fmt.Println("TextContent:", article.TextContent)
return nil
},