aboutsummaryrefslogtreecommitdiff
path: root/Main/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Main/Program.cs')
-rw-r--r--Main/Program.cs58
1 files changed, 14 insertions, 44 deletions
diff --git a/Main/Program.cs b/Main/Program.cs
index 3d56b36..9db50bb 100644
--- a/Main/Program.cs
+++ b/Main/Program.cs
@@ -1,51 +1,21 @@
using System;
+using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Threading.Tasks;
-using System.Collections.Generic;
-
-using Database;
-using Classes;
-using Aggregator.Parser;
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
-namespace Main {
- internal static class Program {
- private static async Task Main(string[] args) {
- List<Config> configs = new List<Config>() {
- new Config() { //BBC
- Source = "BBC",
- Title = 0,
- Description = 1,
- ArticleLink = 2,
- ImageLink = 5,
- PublishDate = 4
- },
- new Config(){ //Sky
- Source = "Sky",
- Title = 0,
- Description = 2,
- ArticleLink = 1,
- ImageLink = 7,
- PublishDate = 3
- },
- new Config(){ //ABC
- Source = "ABC",
- Title = 7,
- Description = 11,
- ArticleLink = 8,
- ImageLink = 0,
- PublishDate = 10
- }
- };
- string[] xmls = new[] {
- await Download.DownloadXML("http://feeds.bbci.co.uk/news/rss.xml"),
- await Download.DownloadXML("http://feeds.skynews.com/feeds/rss/world.xml"),
- await Download.DownloadXML("https://abcnews.go.com/abcnews/topstories")
- };
- List<Article> articles = ParserService.ParseMultiple(xmls, configs).ToList();
-
- using (var db = new DatabaseContext()) {
- await db.InsertArticles(articles);
- }
+namespace Server {
+ public class Program {
+ public static void Main(string[] args) {
+ CreateWebHostBuilder(args).Build().Run();
}
+
+ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
+ WebHost.CreateDefaultBuilder(args)
+ .UseStartup<Startup>();
}
}