commit c9eed50c630173b3863d028acfa2742a07efdae2
Author: A-Konig <alex-nebulae@seznam.cz>
Date:   Fri May 7 17:37:19 2021 +0200

    re #8840 First test

diff --git a/Server/ServerApp/App.config b/Server/ServerApp/App.config
index 5cffe9b..0a131ae 100644
--- a/Server/ServerApp/App.config
+++ b/Server/ServerApp/App.config
@@ -7,7 +7,7 @@
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
+        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
diff --git a/Server/ServerApp/Parser/Parsers/JsonParser.cs b/Server/ServerApp/Parser/Parsers/JsonParser.cs
new file mode 100644
index 0000000..e02eec4
--- /dev/null
+++ b/Server/ServerApp/Parser/Parsers/JsonParser.cs
@@ -0,0 +1,66 @@
+﻿using ServerApp.DataDownload;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+
+namespace ServerApp.Parser.Parsers
+{
+    class JsonParser
+    {
+        DataDownloader loader;
+
+        public JsonParser(DataDownloader loader)
+        {
+            this.loader = loader;
+        }
+
+
+        public void ParsePrediction()
+        {
+            // TODO ask DataDownloader for download said file and return path to it
+            // get file
+            string file = DownloadWeatherPrediction();
+            DateTime now = DateTime.Now;
+            Console.WriteLine(File.Exists(file));
+
+            // parse file
+            string data =  File.ReadAllText(file);
+
+            JsonDocument doc = JsonDocument.Parse(data);
+            JsonElement root = doc.RootElement;
+
+            var users = root.EnumerateObject();
+            while (users.MoveNext())
+            {
+                var user = users.Current;
+                Console.WriteLine(user.Name);
+                
+                /*
+                var props = user.EnumerateObject();
+
+                while (props.MoveNext())
+                {
+                    var prop = props.Current;
+                    Console.WriteLine($"{prop.Name}: {prop.Value}");
+                }
+                */
+            }
+
+        }
+
+        private string DownloadWeatherPrediction()
+        {
+            DateTime now = DateTime.Now;
+            WebClient webClient = new WebClient();
+            webClient.DownloadFile("http://wttr.in/Plzen,czechia?format=j1", $"data/weather/{now.Year}{now.Month}{now.Day}.json");
+
+            return $"data/weather/{now.Year}{now.Month}{now.Day}.json";
+        }
+    }
+}
diff --git a/Server/ServerApp/Program.cs b/Server/ServerApp/Program.cs
index c1c0ac7..61a67ce 100644
--- a/Server/ServerApp/Program.cs
+++ b/Server/ServerApp/Program.cs
@@ -30,6 +30,11 @@ namespace ServerApp
         static void Main(string[] args)
         {
 
+			JsonParser p = new JsonParser(null);
+			p.ParsePrediction();
+
+			/*
+
 			Config config = FillConfigInfo(args);
 			if (config == null)
 			{
@@ -75,6 +80,7 @@ namespace ServerApp
 			{
 				Console.WriteLine(s);
 			}
+			*/
 
 			// test - connection:
 			//ConnectionListener cl = new ConnectionListener(int.Parse(args[0])/*8000*//*int.Parse(config.Port)*/);
diff --git a/Server/ServerApp/ServerApp.csproj b/Server/ServerApp/ServerApp.csproj
index 2abcf83..f55a34f 100644
--- a/Server/ServerApp/ServerApp.csproj
+++ b/Server/ServerApp/ServerApp.csproj
@@ -57,6 +57,9 @@
     <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.ML, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.ML.1.5.5\lib\netstandard2.0\Microsoft.ML.dll</HintPath>
     </Reference>
@@ -88,8 +91,8 @@
       <HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="System" />
-    <Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
+    <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
     </Reference>
     <Reference Include="System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\System.CodeDom.4.4.0\lib\net461\System.CodeDom.dll</HintPath>
@@ -106,14 +109,20 @@
       <Private>True</Private>
     </Reference>
     <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
+      <HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
     </Reference>
     <Reference Include="System.Numerics" />
-    <Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
+    <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
     </Reference>
-    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
+    <Reference Include="System.Text.Encodings.Web, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Text.Encodings.Web.5.0.1\lib\net461\System.Text.Encodings.Web.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Text.Json, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.Text.Json.5.0.2\lib\net461\System.Text.Json.dll</HintPath>
     </Reference>
     <Reference Include="System.Threading.Channels, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\System.Threading.Channels.4.7.1\lib\net461\System.Threading.Channels.dll</HintPath>
@@ -121,6 +130,9 @@
     <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
     </Reference>
+    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
+    </Reference>
     <Reference Include="System.Web" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
@@ -149,6 +161,7 @@
     <Compile Include="Parser\OutputInfo\WindInfo.cs" />
     <Compile Include="Parser\Parsers\DataParser.cs" />
     <Compile Include="Parser\Parsers\JisParser.cs" />
+    <Compile Include="Parser\Parsers\JsonParser.cs" />
     <Compile Include="Parser\Parsers\LogInParser.cs" />
     <Compile Include="Parser\Parsers\TagInfo.cs" />
     <Compile Include="Parser\Parsers\WeatherParser.cs" />
diff --git a/Server/ServerApp/packages.config b/Server/ServerApp/packages.config
index de47ae5..c894fd9 100644
--- a/Server/ServerApp/packages.config
+++ b/Server/ServerApp/packages.config
@@ -1,17 +1,21 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <packages>
+  <package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net472" />
   <package id="Microsoft.ML" version="1.5.5" targetFramework="net472" />
   <package id="Microsoft.ML.CpuMath" version="1.5.5" targetFramework="net472" />
   <package id="Microsoft.ML.DataView" version="1.5.5" targetFramework="net472" />
   <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net472" />
-  <package id="System.Buffers" version="4.4.0" targetFramework="net472" />
+  <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
   <package id="System.CodeDom" version="4.4.0" targetFramework="net472" />
   <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
   <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net472" />
-  <package id="System.Memory" version="4.5.3" targetFramework="net472" />
-  <package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" />
+  <package id="System.Memory" version="4.5.4" targetFramework="net472" />
+  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
   <package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net472" />
-  <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" />
+  <package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
+  <package id="System.Text.Encodings.Web" version="5.0.1" targetFramework="net472" />
+  <package id="System.Text.Json" version="5.0.2" targetFramework="net472" />
   <package id="System.Threading.Channels" version="4.7.1" targetFramework="net472" />
   <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
+  <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
 </packages>
\ No newline at end of file
