Beispiel #1
0
        public void AddUrlChannelItems(Channel channel, List <ListItem> listItems, DateTime dateContext, bool bypassCaches)
        {
            List <FeedItem> feedItems = this.GetFeedItems(dateContext, bypassCaches);

            this.Save();

            foreach (FeedItem feedItem in feedItems)
            {
                UrlChannelItem urlChannelItem = new UrlChannelItem(feedItem.pubDate, feedItem.imageUrl, feedItem.imageWidth, feedItem.imageHeight);
                urlChannelItem.Channel = channel;
                urlChannelItem.ExpDate = this.ItemsInvalidDate;
                listItems.Add((ChannelItem)urlChannelItem);
            }
        }
Beispiel #2
0
        public override List <ListItem> InitItems(List <Guid> guidContext, DateTime dateContext, bool bypassCaches, Hashtable compileState)
        {
            List <ListItem> listItems = new List <ListItem>();

            string url = this.imageUrl;

            if (this.addTimeIndex)
            {
                url = MiscUtil.AppendQueryStringParameter(url, MiscUtil.TimeIndex());
            }

            UrlChannelItem urlChannelItem = new UrlChannelItem(dateContext, url, -1, -1);

            urlChannelItem.Channel = this;

            listItems.Add(urlChannelItem);

            return(listItems);
        }
Beispiel #3
0
        public override List <ListItem> InitItems(List <Guid> guidContext, DateTime dateContext, bool bypassCaches, System.Collections.Hashtable compileState)
        {
            List <ListItem> items = new List <ListItem>();

            Feed feed = Feed.LoadRssFeed(this.RssFeedUrl, this.rssChannelPriority);

            List <FeedItem> feedItems = feed.GetFeedItems(dateContext, bypassCaches);

            feed.Save();

            if (this.renderChannelTitle)
            {
                this.channelTitle = feed.Title;
            }

            if (this.renderChannelImage)
            {
                this.channelImageUrl = feed.LogoUrl;
            }

            foreach (FeedItem feedItem in feedItems)
            {
                if ((this.rssChannelPriority == RssChannelPriority.Text && !String.IsNullOrEmpty(feedItem.description)) ||
                    (String.IsNullOrEmpty(feedItem.imageUrl))
                    )
                {
                    TextRssChannelItem textRssChannelItem = new TextRssChannelItem(feedItem.pubDate, feedItem.title, feedItem.description);
                    textRssChannelItem.Channel = this;
                    textRssChannelItem.ExpDate = feed.ItemsInvalidDate;
                    items.Add((ChannelItem)textRssChannelItem);
                }
                else
                {
                    UrlChannelItem urlChannelItem = new UrlChannelItem(feedItem.pubDate, feedItem.imageUrl, feedItem.imageWidth, feedItem.imageHeight);
                    urlChannelItem.Channel = this;
                    urlChannelItem.ExpDate = feed.ItemsInvalidDate;
                    items.Add((ChannelItem)urlChannelItem);
                }
            }

            return(items);
        }