Example #1
0
        public ActionResult Rss()
        {
            if (Request.QueryString["fbsrc"] != "Y" && Request.QueryString["sneak"] != "Y")
            {
                return(new RedirectResult("http://syndication.thedailywtf.com/TheDailyWtf", false));
            }

            return(new RssArticlesResult(ArticleModel.GetRecentArticles(15)));
        }
Example #2
0
        public ActionResult ViewRecentArticlesByCount(int count = 8)
        {
            if (count > 100)
            {
                return(ErrorStatus(HttpStatusCode.BadRequest, "Count cannot be greater than 100"));
            }

            var articles = ArticleModel.GetRecentArticles(count);

            if (IsEmpty(articles))
            {
                return(ErrorStatus(HttpStatusCode.ServiceUnavailable, "Service Unavailable"));
            }

            return(FormatOutput(articles));
        }
Example #3
0
        public string ViewRecentArticlesByCount(int count = 8)
        {
            if (count > 100)
            {
                return(ErrorStatus("Count cannot be greater than 100"));
            }

            var articles = ArticleModel.GetRecentArticles(count);

            if (IsEmpty(articles))
            {
                return(ErrorStatus("Service Unavailable"));
            }

            return(FormatOutput(articles));
        }