Exemplo n.º 1
0
        public void URLSeriveTest()
        {
            string text = @"https://www.4guysfromrolla.com/articles/011211-1.aspx";

            MyAnalyzer service = new MyAnalyzer();
            string     host    = "4guysfromrolla";
            var        result  = service.GetSiteResults(url: text, host: "");
        }
Exemplo n.º 2
0
        public ActionResult Analyze(string webURL, string isEnabledAnalyze)
        {
            ViewMessage viewMessage = null;

            if (string.IsNullOrWhiteSpace(isEnabledAnalyze))
            {
                if (!string.IsNullOrWhiteSpace(webURL))
                {
                    Uri uriResult;
                    if (Uri.TryCreate(webURL, UriKind.Absolute, out uriResult))
                    {
                        var analyzer = new MyAnalyzer();
                        viewMessage = analyzer.GetSiteResults(url: webURL, host: uriResult.Host);
                        if (string.Compare(viewMessage.StatusID, "0") != 0)
                        {
                            return(View("Index", viewMessage));
                        }
                        return(View("AnalyzeSite", viewMessage));
                    }
                    else
                    {
                        // Text mode
                        var analyzer = new MyAnalyzer();
                        viewMessage = analyzer.GetWordResults(webURL);
                        return(View("AnalyzeText", viewMessage));
                    }
                }
                // SEO disabled
                return(View("Index", new ViewMessage()
                {
                    StatusID = "1",
                    Message = "Please submit text or URL."
                }));
            }
            else
            {
                // SEO disabled
                return(View("Index", new ViewMessage()
                {
                    StatusID = "1",
                    Message = "SEO is Disabled.",
                    isEnabledAnalyzeChecked = isEnabledAnalyze != null
                }));
            }
        }