Example #1
0
        private static void ShowLatest10Articles()
        {
            var json = ApiCommunication.GetFromMimer(ApiCommunication.ResourceTypes.LatestArticles);

            var articles = Article.GetArticlesFromJson(json);

            foreach (var article in articles.Take(10))
            {
                Console.WriteLine(article.Title);
            }
        }
Example #2
0
        private static void ShowSitesManagedByFrontpageEditors()
        {
            var json = ApiCommunication.GetFromMimer(ApiCommunication.ResourceTypes.AllSites);

            var sites = Site.GetSitesFromJson(json);

            foreach (var site in sites.Where(c => c.SiteInfoCollectionBody == "*****@*****.**"))
            {
                if (!string.IsNullOrEmpty(site.Title))
                {
                    Console.WriteLine(site.Title);
                }
                else if (!string.IsNullOrEmpty(site.Name))
                {
                    Console.WriteLine(site.Name);
                }
                else
                {
                    Console.WriteLine("Data mangler");
                }
            }
        }