mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
substitute post content where possible
This commit is contained in:
@@ -63,11 +63,17 @@ func (e *Feeds) fetch(f *feeds.Feed) error {
|
|||||||
tags = append(tags, f.Category)
|
tags = append(tags, f.Category)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if content exists
|
||||||
|
content := item.Content
|
||||||
|
if len(content) == 0 && len(item.Summary) > 0 {
|
||||||
|
content = item.Summary
|
||||||
|
}
|
||||||
|
|
||||||
// @todo make this optional
|
// @todo make this optional
|
||||||
_, err := e.postsService.Save(context.TODO(), &posts.SaveRequest{
|
_, err := e.postsService.Save(context.TODO(), &posts.SaveRequest{
|
||||||
Id: id,
|
Id: id,
|
||||||
Title: item.Title,
|
Title: item.Title,
|
||||||
Content: item.Content,
|
Content: content,
|
||||||
Timestamp: item.Date.Unix(),
|
Timestamp: item.Date.Unix(),
|
||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"domain": domain,
|
"domain": domain,
|
||||||
|
|||||||
Reference in New Issue
Block a user