RssItem.parse constructor
RssItem.parse(
- XmlElement element
Parse constructor for the RssItem class, used when 'parsing' a feed
Implementation
factory RssItem.parse(XmlElement element) => RssItem(
title: element.findElements('title').firstOrNull?.innerText,
description: removeHtml(
element.findElements('description').firstOrNull?.innerText,),
link: element.findElements('link').firstOrNull?.innerText,
categories:
element.findElements('category').map(RssCategory.parse).toList(),
guid: element.findElements('guid').firstOrNull?.innerText,
pubDate: parseDateTime(
element.findElements('pubDate').firstOrNull?.innerText,),
author: element.findElements('author').firstOrNull?.innerText,
comments: element.findElements('comments').firstOrNull?.innerText,
source: element.findElements('source').map(RssSource.parse).firstOrNull,
content: element
.findElements('content:encoded')
.map(RssContent.parse)
.firstOrNull,
media: Media.parse(element),
enclosure: element
.findElements('enclosure')
.map(RssEnclosure.parse)
.firstOrNull,
dc: DublinCore.parse(element),
itunes: Itunes.parse(element),
);