public static void Main(string[] args) { while (true) { Repository rep = new Repository(); DataParcer dparc = new DataParcer(); List <OrgResponce> orgList = rep.ReadCsvFile(); if (orgList.Count > 0) { foreach (OrgResponce or in orgList) { Debug.WriteLine(or.Name); string url = rep.CreateTenderUrl(or.Name); string tenderResp = rep.GetTenderResponce("http://mmk.ru/for_suppliers/auction/source_all.php?LOCATION_CODE=" + url); List <String> lotJsons = rep.GetPageTendersOrg("http://mmk.ru/for_suppliers/auction/source_all.php?LOCATION_CODE=" + url); List <String> notModels = dparc.ParceTenders(tenderResp, lotJsons, or); foreach (string mod in notModels) { rep.SendToRedis(mod); } } Thread.Sleep(3600000); } Console.ReadLine(); } }
public List <String> GetPageTendersOrg(string url) { string resp = GET(url + ((int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds).ToString()); Debug.WriteLine("resp= " + resp); DataParcer dp = new DataParcer(); List <string> lotJsons = new List <string>(); List <string> lotUrls = dp.ParceLotUrl(resp); foreach (string lotUrl in lotUrls) { string lotJson = GET("http://mmk.ru/for_suppliers/auction/source_dt_l.php?" + lotUrl); lotJsons.Add(lotJson); } // CreateModel(tr); return(lotJsons); }