aboutsummaryrefslogtreecommitdiff
path: root/Aggregator/Main/Program.cs
blob: 80fd62ac568cbd43a6c71fa0bd3dbec4251b139b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using Aggregator.Classes;
using Aggregator.Parser;

namespace Main {
    internal static class Program {
        private static async Task Main(string[] args) {
            List<Config> configs = new List<Config>() {
                new Config() {
                    Source = "BBC",
                    Title = 0,
                    Description = 1,
                    ArticleLink = 2,
                    ImageLink = 5,
                    PublishDate = 4
                }
            };
            string[] xmls = new [] {
                await Download.DownloadXML("http://feeds.bbci.co.uk/news/rss.xml")
            };
            List<Article> articles = ParserService.ParseMultiple(xmls, configs).ToList();
            Console.WriteLine(articles.Count);
        }
    }
}