private void Collect() { var configPath = Path.Combine(Directory.GetCurrentDirectory(), "Config", "ParseConfig.json"); var config = JsonParseConfig.Load(configPath); var collector = new SitePriceCollector(new SQLiteResultSaver(), config, new LoaderFactory(null)); collector.Collect(); }
public Quotation Parse(string content, JsonParseConfig config) { var o = JObject.Parse(content); var time = o.SelectToken(config.TimeJPath).ToString(); var quotation = new Quotation { Time = TimeParse.Parse(config.TimeParseFun, time), Price = double.Parse(o.SelectToken(config.PriceJPath).ToString()), Volume = double.Parse(o.SelectToken(config.VolumeJPath).ToString()), }; return(quotation); }