Add image from jsonfeed
This commit is contained in:
parent
d1afcd121e
commit
24c6cb0672
|
|
@ -277,6 +277,7 @@ func (b *memoryBackend) feedItems(fetchURL, contentType string, body io.Reader)
|
||||||
item.Id = hex.EncodeToString([]byte(feedItem.ID))
|
item.Id = hex.EncodeToString([]byte(feedItem.ID))
|
||||||
item.Published = feedItem.DatePublished
|
item.Published = feedItem.DatePublished
|
||||||
item.Author = author
|
item.Author = author
|
||||||
|
item.Photo = feedItem.Image
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
} else if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/rss+xml") || strings.HasPrefix(contentType, "application/atom+xml") {
|
} else if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/rss+xml") || strings.HasPrefix(contentType, "application/atom+xml") {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ type JSONFeedItem struct {
|
||||||
Summary string `json:"summary,omitempty"`
|
Summary string `json:"summary,omitempty"`
|
||||||
Title string `json:"title,omitempty"`
|
Title string `json:"title,omitempty"`
|
||||||
URL string `json:"url,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
ExternalURL string `json:"external_url,omitempty"`
|
ExternalURL string `json:"external_url,omitempty"`
|
||||||
DatePublished string `json:"date_published,omitempty"`
|
DatePublished string `json:"date_published,omitempty"`
|
||||||
Tags []string `json:"tags,omitempty"`
|
Tags []string `json:"tags,omitempty"`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user