Fix archive cmd panic on short content (#9) #34
@@ -106,6 +106,15 @@ func main() {
|
|||||||
return err
|
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("Title:", article.Title)
|
||||||
fmt.Println("Byline:", article.Byline)
|
fmt.Println("Byline:", article.Byline)
|
||||||
fmt.Println("Site:", article.SiteName)
|
fmt.Println("Site:", article.SiteName)
|
||||||
@@ -113,7 +122,7 @@ func main() {
|
|||||||
fmt.Println("Excerpt:", article.Excerpt)
|
fmt.Println("Excerpt:", article.Excerpt)
|
||||||
fmt.Println("Length:", article.Length)
|
fmt.Println("Length:", article.Length)
|
||||||
fmt.Println("Lang:", article.Lang)
|
fmt.Println("Lang:", article.Lang)
|
||||||
fmt.Println("Content:", article.Content[:32]+"...")
|
fmt.Println("Content:", content)
|
||||||
fmt.Println("TextContent:", article.TextContent)
|
fmt.Println("TextContent:", article.TextContent)
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user