예제 #1
0
func itmify(o *rss.Item, ch *rss.Channel) Itm {
	var x Itm
	x.Title = o.Title
	x.Links = o.Links
	x.ChannelKey = ch.Key()
	x.Description = o.Description
	x.Author = o.Author
	x.Categories = o.Categories
	x.Comments = o.Comments
	x.Enclosures = o.Enclosures
	x.Guid = o.Guid
	x.PubDate = o.PubDate
	x.Id = o.Id
	x.Key = o.Key()
	x.Generator = o.Generator
	x.Contributors = o.Contributors
	x.Content = o.Content
	x.Extensions = o.Extensions
	x.Date, _ = o.ParsedPubDate()

	if o.Content != nil && o.Content.Text != "" {
		x.FullContent = o.Content.Text
	} else {
		x.FullContent = o.Description
	}

	return x
}