All pastes #169417 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-13 21:48 UTC
rendered paste body
            List<Post> posts = Post.GetList(l);

            string description = "All that is Yaguchi goes here";
            linkbase = "http://www.yaguchimari.org/articles/";
            
            RssFeed feed = new RssFeed(
                Constants.GetHeader(l),
                "http://www.yaguchimari.org/",
                description,
                l.ISOcode);
            
            int numPosts = posts.Count > 10 ? 10 : posts.Count;
            for (int i = 0; i < numPosts ; i++)
            {
                Post p = posts[i];
                string link = string.Format("{0}/{1}/{2}.aspx", linkbase, p.ID, Util.UrlClean(p.Header));

                string contentData = p.Text;
                if (p.Topic.HasRating)
                {
                    contentData += String.Format("\n{0}: {1}", Constants.GetEpisodeRanking(l), p.Rating);
                }
                if (p.Images.Count != 0)
                {
                    contentData += "\nCheck the site for screenshots!";
                }
                contentData = "<p>" + Util.HtmlEncode(contentData) + "</p>";
                
                RssItem item = new RssItem(p.Header, link, contentData, p.PostDate, link);
                feed.Items.Add(item);
            }

            feedtext = feed.ToString();