public static void SetPath(string path, LogManager logger = null) { SURVEYS_PATH = path; MISSING_PATH = SURVEYS_PATH + "MissingLocationCodes.txt"; UPLOADED_PATH = SURVEYS_PATH + "{0} - Uploaded.txt"; Missing = File.Exists(MISSING_PATH) ? File.ReadAllLines(MISSING_PATH) : Array.Empty <string>(); Uploaded = File.Exists(UPLOADED_PATH) ? File.ReadAllLines(UPLOADED_PATH) : Array.Empty <string>(); if (logger != null) { logger.AddLogs(MISSING_PATH, UPLOADED_PATH); Logger = logger; } }
public ZillowClient(LogManager logger) { //Cookies.Add(new Cookie("abtest", "3|DFOTjAcraKnyD7HhsQ") { Domain="www.zillow.com"}); //Cookies.Add(new Cookie("zguid", "23|%2495fd25c7-d4d2-41e4-b5e0-ba86cfb225f0") { Domain = "www.zillow.com" }); //Cookies.Add(new Cookie("AWSALB", "9WQXqggXL5y1P0Oug6XDGLOhauE4YLH1TT7XUvqaMs75/vvrzcRfBmY9v7tUoUlkfqs8SVXNuLza0Qf284CMXZAIXfkKWY6Pa6WRe292SuKMJZXzmBA40DxZq0t+") { Domain = "www.zillow.com" }); this.Logger = logger; Logger.AddLogs(LOGS_PATH, LOGS_PATH + "MissingAddresses.txt"); //logMissingAddresses = new StreamWriter(LOGS_PATH + "MissingAddresses.txt", true); ZWSID = ZWSIDs[0]; this.curZWSID = 0; SearchClient = new RestClient("http://www.zillow.com/webservice/"); SearchClient.CookieContainer = Cookies; SearchClient.AddDefaultParameter("zws-id", ZWSID, ParameterType.GetOrPost); DetailsClient = new RestClient("https://www.zillow.com/homes/"); DetailsClient.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"; DetailsClient.CookieContainer = Cookies; }