aboutsummaryrefslogtreecommitdiff
path: root/Main
diff options
context:
space:
mode:
Diffstat (limited to 'Main')
-rw-r--r--Main/Main.csproj14
-rw-r--r--Main/Program.cs28
2 files changed, 42 insertions, 0 deletions
diff --git a/Main/Main.csproj b/Main/Main.csproj
new file mode 100644
index 0000000..dd85bc5
--- /dev/null
+++ b/Main/Main.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\Classes\Classes.csproj" />
+ <ProjectReference Include="..\Parser\Parser.csproj" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.1</TargetFramework>
+ <LangVersion>Latest</LangVersion>
+ </PropertyGroup>
+
+</Project>
diff --git a/Main/Program.cs b/Main/Program.cs
new file mode 100644
index 0000000..80fd62a
--- /dev/null
+++ b/Main/Program.cs
@@ -0,0 +1,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);
+ }
+ }
+}