aboutsummaryrefslogtreecommitdiff
path: root/Main/Program.cs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadevchavali1@gmail.com>2019-02-08 10:49:19 +0000
committerAryadev Chavali <aryadevchavali1@gmail.com>2019-02-08 10:49:19 +0000
commita26d25ba319e7fdacb47bf8b66e22ca3189fb0d9 (patch)
treedb77cc3c0d4b3b4cb57f7bed7768eb8f905198f3 /Main/Program.cs
parent108fbc3f497babeceb83a7e0e720127fa26a7db3 (diff)
downloadnewsaggregator-a26d25ba319e7fdacb47bf8b66e22ca3189fb0d9.tar.gz
newsaggregator-a26d25ba319e7fdacb47bf8b66e22ca3189fb0d9.tar.bz2
newsaggregator-a26d25ba319e7fdacb47bf8b66e22ca3189fb0d9.zip
Moved main outside for usage in general purpose
Diffstat (limited to 'Main/Program.cs')
-rw-r--r--Main/Program.cs28
1 files changed, 28 insertions, 0 deletions
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);
+ }
+ }
+}