Example #1
0
 private static void GetNumArticlesForDistricts()
 {
     var client = new ArticleClient();
     foreach (var district in Bezirke.Keys)
     {
         client.GetNumArticlesForDistrict(district);
     }
     Console.ReadLine();
 }
Example #2
0
 private static void GetKeywordsForDistricts()
 {
     var client = new ArticleClient();
     foreach (var district in Bezirke.Keys)
     {
         Console.WriteLine(district);
         var result = client.GetKeywordsForDistrict(district);
         string text = String.Join("\r\n", result.OrderBy(r => r).ToArray());
         Directory.CreateDirectory("C:\\temp\\keywords\\");
         File.AppendAllText("C:\\temp\\keywords\\" + district + ".txt", text);
     }
     Console.WriteLine("done");
     Console.ReadLine();
 }
Example #3
0
 private static Dictionary<string, List<News>> GetNewsForDistricts()
 {
     var client = new ArticleClient();
     Dictionary<string, List<News>> news = new Dictionary<string, List<News>>();
     foreach (var kv in Bezirke)
     {
         if (!news.ContainsKey(kv.Value))
         {
             Console.WriteLine(kv.Key);
             news[kv.Value] = new List<News>();
             var districtNews = client.GetNewsForDistrict(kv.Key);
             news[kv.Value].AddRange(districtNews);
         }
     }
     return news;
 }
Example #4
0
        private static void GetHistogram()
        {
            var client = new ArticleClient();
            Dictionary<string, int> hist = new Dictionary<string, int>();
            foreach (var district in Bezirke.Keys)
            {
                Console.WriteLine(district);
                client.GetHistogram(district, hist);

            }
            Directory.CreateDirectory("C:\\temp\\keywords\\");
            string text = String.Join("\r\n", hist.OrderBy(r => r.Value).Select(r => r.Key + ": " + r.Value).ToArray());
            File.AppendAllText("C:\\temp\\keywords\\histogram.txt", text);
            Console.WriteLine("done");
            Console.ReadLine();
        }