示例#1
0
        private (bool, string) GetContent_(RssItem item)
        {
            if (!item.HasExtensions)
            {
                return(false, item.Description);
            }
            var extension = item.FindExtension <SiteSummaryContentSyndicationExtension>();

            if (extension == null || extension.Context.Encoded.IsNullOrWhitespace())
            {
                return(false, item.Description);
            }
            return(true, extension.Context.Encoded);
        }
示例#2
0
        private DateTime GetDate_(RssItem item)
        {
            if (item.PublicationDate.Date != nullDate || !item.HasExtensions)
            {
                return(item.PublicationDate);
            }
            var extension = item.FindExtension <DublinCoreElementSetSyndicationExtension>();

            if (extension == null)
            {
                return(item.PublicationDate);
            }
            return(extension.Context.Date);
        }
示例#3
0
        private string GetAuthor_(RssItem item)
        {
            if (!item.Author.IsNullOrWhitespace() || !item.HasExtensions)
            {
                return(item.Author);
            }
            var extension = item.FindExtension <DublinCoreElementSetSyndicationExtension>();

            if (extension == null)
            {
                return(item.Author);
            }
            return(extension.Context.Creator);
        }
示例#4
0
        private static string GetRssContent(RssItem item)
        {
            var contentExtension = item.FindExtension <SiteSummaryContentSyndicationExtension>();

            return(contentExtension != null ? contentExtension.Context.Encoded : item.Description);
        }
示例#5
0
        private string GetRssAuthors(RssItem item)
        {
            var dcExtension = item.FindExtension <DublinCoreElementSetSyndicationExtension>();

            return(dcExtension != null ? dcExtension.Context.Creator : String.Empty);
        }