예제 #1
0
        private static GTmetrix GTmetrixAnalyse(string companyUrl)
        {
            var uri = @"https://gtmetrix.com/reports/" + companyUrl;

            HtmlWeb      web = new HtmlWeb();
            HtmlDocument doc = new HtmlDocument();

            try
            {
                doc = web.Load(uri);
            }
            catch (Exception)
            {
            }

            var pageSpeed = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.PageSpeed)?.InnerText.RemoveNumericFormat().TryToInt();
            var yslow     = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.YSlow)?.InnerText.RemoveNumericFormat().TryToInt();
            var pageLoad  = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.PageLoad)?.InnerText.RemoveNumericFormat().Replace("s", "").TryToDecimal();
            var pageSize  = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.PageSize)?.InnerText.RemoveNumericFormat().Replace("MB", "").TryToDecimal();

            var gtmetrix = new GTmetrix
            {
                PageSpeed = pageSpeed,
                YSlow     = yslow,
                PageLoad  = pageLoad,
                PageSize  = pageSize
            };

            return(gtmetrix);
        }
예제 #2
0
 public Company()
 {
     Alexa        = new Alexa();
     SiteRankData = new SiteRankData();
     SimilarWeb   = new SimilarWeb();
     GTmetrix     = new GTmetrix();
     Whois        = new Whois();
 }
예제 #3
0
        public string TitleCSV()
        {
            var result = $"نام شرکت,آدرس,{Alexa.TitleCSV()},{SiteRankData.TitleCSV()},{SimilarWeb.TitleCSV()},{GTmetrix.TitleCSV()},{Whois.TitleCSV()}{Environment.NewLine}";

            return(result);
        }
예제 #4
0
        public string CompanyToCSV()
        {
            var result = $"{Name},{Url},{Alexa.ToCSV()},{SiteRankData.ToCSV()},{SimilarWeb.ToCSV()},{GTmetrix.ToCSV()},{Whois.ToCSV()}{Environment.NewLine}";

            return(result);
        }