public void GetFoundedDate() { //get all entries with 1/1/1900, name and domain name List <string[]> entries = GetAll1900s(); Crunch crunch = new Crunch(new CrunchbaseTestDataSource()); List <Company> _allCompanies = new CompanyManager().GetAllCompanies(); foreach (string[] item in entries) { try { Company co = _allCompanies.Where(com => com.name.Trim().ToLowerInvariant() == item[1].Trim().ToLowerInvariant()).FirstOrDefault(); if (!Object.Equals(co, null)) { CompanyRoot cor = crunch.GetFullCompany(co.permalink, new Dig()); if (!Object.Equals(cor, null)) { cor.homepage_url = cor.homepage_url.Replace("http://", "").Replace("https://", "").Replace("www.", "").TrimEnd(new char[] { '/' }); if (cor.homepage_url == item[0]) { CrunchbaseDataSource ds = new CrunchbaseDataSource(); CrunchbaseDataComponent _dataComponent = crunch.DroneDataComponent as CrunchbaseDataComponent; if (cor.founded_year != null || cor.founded_month != null || cor.founded_day != null) { _dataComponent.CompanyLocal = cor; ds.Process(_dataComponent); } } } } else { //name lookup failed. } } catch (Exception) { } } }
public QueueCrunchbase() : base() { QueueComponentDataSource = new CrunchbaseDataSource(); }
public Crunch() : base() { DroneDataSource = new CrunchbaseDataSource(); }