public GoogleResult(int resultIndex, IWebResult result)
 {
     this.Result     = result;
     this.Index      = resultIndex;
     this.Title      = result.Title;
     this.VisibleUrl = result.VisibleUrl;
     this.Url        = result.Url;
     this.Content    = result.Content;
     this.CacheUrl   = result.CacheUrl;
 }
Exemplo n.º 2
0
 /// <summary>
 /// It's a contructor, Yo.
 /// </summary>
 /// <param name="result">The result that our Lord and Savior, Google, Sent.</param>
 public SearchResultLink(IWebResult result)
 {
     InitializeComponent();
     this.ResultTitle.Text = result.Title;
     this.ResultURL.Text = result.VisibleUrl;
     this.ResultDescription.Text = result.Content;
     this.Load += delegate(object a, EventArgs b)
     {
         this.BackColor = System.Drawing.Color.White;
         this.Height = this.ResultDescription.Bottom + 10;
     };
     this.Click += Open;
     this.ResultDescription.Click += Open;
     this.ResultTitle.Click += Open;
     this.ResultURL.Click += Open;
     this.URL = result.Url;
     ToolTip tt = new ToolTip();
     tt.ToolTipIcon = ToolTipIcon.None;
     tt.ShowAlways = true;
     tt.SetToolTip(this.ResultTitle, this.ResultTitle.Text);
     tt.SetToolTip(this.ResultURL, this.URL);
     tt.SetToolTip(this.ResultDescription, this.ResultDescription.Text);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Makes the crawled page.
        /// </summary>
        /// <param name="result">The result.</param>
        /// <param name="pRecord">The p record.</param>
        /// <returns></returns>
        /// <exception cref="aceGeneralException">Error in link processing</exception>
        internal crawledPage makeCrawledPage(IWebResult result, modelSpiderPageRecord pRecord)
        {
            crawledPage page = new crawledPage(result.responseUrl, 0);

            page.result = result;
            page.domain = pRecord.wRecord.domainInfo.domainName;

            var links = result.HtmlDocument.DocumentNode.Descendants("a");

            if (links.Any())
            {
            }
            else
            {
            }


            foreach (HtmlNode hn in links)
            {
                try
                {
                    var  ndv = hn.CreateNavigator();
                    link l   = new link(ndv);
                    if (!l.isDefaultHomePage)
                    {
                        page.links.Add(l);
                    }
                }
                catch (Exception ex)
                {
                    throw new aceGeneralException(ex.Message, ex, page, "Error in link processing");
                }
            }

            if (page.links.Count == 0)
            {
            }

            var meta = result.HtmlDocument.DocumentNode.Descendants("meta");

            foreach (HtmlNode hn in meta)
            {
                String name    = hn.GetAttributeValue("name", "none");
                String content = hn.GetAttributeValue("content", "");

                switch (name)
                {
                case "keywords":
                    page.pageKeywords = content.SplitSmart(",", "", true, true);
                    break;

                case "description":
                    page.pageDescription = content;
                    break;
                }
            }

            var title = result.HtmlDocument.DocumentNode.Descendants("title").FirstOrDefault();

            if (title != null)
            {
                page.pageCaption = title.InnerText;
            }


            page.links.deployCollection(page);

            page.isCrawled = true;
            page.status    = pageStatus.loaded;

            if (!page.links.byScope[imbCommonModels.enums.linkScope.inner].Any())
            {
            }

            return(page);
        }
 public GoogleResult( int resultIndex, IWebResult result )
 {
     this.Result = result;
     this.Index = resultIndex;
     this.Title = result.Title;
     this.VisibleUrl = result.VisibleUrl;
     this.Url = result.Url;
     this.Content = result.Content;
     this.CacheUrl = result.CacheUrl;
 }