public void GetRawDataG() { for (int i = 0; i < humanlist.Count; i++) { double rate = 0; long begin = DateTime.Now.Ticks; GQueryService service = new GQueryService(humanlist[i].name + " " + humanlist[i].city1); List<GQueryResult> result = service.GetResult(); // if (result.Count != 0) Console.WriteLine("Status OK in Google results"); // foreach (var item in result) { if (GetResponse(item.Url, Encoding.UTF8)) { humans.Add(humanlist[i], geturls(htmlpage)); SmartAnalyse(false); rate = SmartGoogleAnalyse(); } } TimeSpan span = new TimeSpan(DateTime.Now.Ticks - begin); if (span.TotalSeconds < 5) Thread.Sleep((5 - (int)span.TotalSeconds)*1000); } }
public void GetRawDataG() { mre.WaitOne(); for (int i = 0; i < manlist.Count; i++) { string query; if (manlist[i] != null) { for (int j = 2; j >= 2; j--) { long begin = DateTime.Now.Ticks; query = SmartQueryToGoogle(i, j); if (query != null && query != "") { GQueryService service = new GQueryService(query); List<GQueryResult> result = service.GetResult(); if (result != null && result.Count > 0) { foreach (var item in result) { if (j == 0 || j == 1) { if (item.Title.Contains(manlist[i].nicks[j].ToString()) || ( item.Content != null && item.Content.Contains(manlist[i].nicks[j].ToString()))) { if (item.Url.Contains("http")) manlist[i].find(item.Url); } } else if (j == 2) { if (item.Title.Contains(manlist[i].name) || item.Title.Contains(manlist[i].eman(manlist[i].name)) || item.Content.Contains(manlist[i].name) || item.Content.Contains(manlist[i].eman(manlist[i].name))) { if (item.Url.Contains("http")) manlist[i].find(item.Url); } } } } } if (manlist[i].links.Count >= 5) break; TimeSpan span = new TimeSpan(DateTime.Now.Ticks - begin); if (span.TotalSeconds < 4) { int duration = 4 - (int)span.TotalSeconds; Thread.Sleep(duration * 1000); } } } } }