예제 #1
0
        public StructuredResult GetTheResults()
        {
            Collection <StructuredResultElement> ResultItems = new Collection <StructuredResultElement>();
            int TotalGoogle = 0;
            int TotalLive   = 0;
            int TotalYahoo  = 0;

            // We check if the google search option is enabled
            if (this.g_google)
            {
                // We check if this is a Google Hack Query and whether the Google Hack option is enabled or not
                if ((this.g_query.QueryGoogleHack && this.g_ggh) || (!this.g_query.QueryGoogleHack))
                {
                    Api_G the_obj = new Api_G(this.g_gkey, this.g_query.QueryString, this.g_query.QueryStart, this.g_query.QueryLength, this.g_gaura);
                    StructuredEngineResult resultitem = the_obj.GetResults();
                    TotalGoogle = resultitem.ResultTotal;
                    foreach (StructuredResultElement res_itm in resultitem.ResultItems)
                    {
                        ResultItems.Add(res_itm);
                    }
                }
            }
            // We check if the MSN Live search option is enaled
            if (this.g_live)
            {
                // We check if this is a Google Hack Query and whether the Google Hack option is enabled or not
                if ((this.g_query.QueryGoogleHack && this.g_lgh) || (!this.g_query.QueryGoogleHack))
                {
                    Api_L the_obj = new Api_L(this.g_lkey, this.g_query.QueryString, this.g_query.QueryStart, this.g_query.QueryLength);
                    StructuredEngineResult resultitem = the_obj.GetResults();
                    TotalLive = resultitem.ResultTotal;
                    foreach (StructuredResultElement res_itm in resultitem.ResultItems)
                    {
                        ResultItems.Add(res_itm);
                    }
                }
            }
            // We check if the Yahoo search option is enabled
            if (this.g_yahoo)
            {
                // We check if this is a Google Hack Query and whether the Google Hack option is enabled or not
                if ((this.g_query.QueryGoogleHack && this.g_ygh) || (!this.g_query.QueryGoogleHack))
                {
                    Api_Y the_obj = new Api_Y(this.g_ykey, this.g_query.QueryString, this.g_query.QueryStart, this.g_query.QueryLength);
                    StructuredEngineResult resultitem = the_obj.GetResults();
                    TotalYahoo = resultitem.ResultTotal;
                    foreach (StructuredResultElement res_itm in resultitem.ResultItems)
                    {
                        ResultItems.Add(res_itm);
                    }
                }
            }
            g_result.ResultStart       = g_query.QueryStart;
            g_result.ResultEnd         = g_query.QueryLength;
            g_result.ResultQueryString = g_query.QueryString;
            g_result.ResultTotal       = TotalGoogle + TotalLive + TotalYahoo;
            g_result.ResultItems       = ResultItems;
            g_result.ResultGoogleTotal = TotalGoogle;
            g_result.ResultLiveTotal   = TotalLive;
            g_result.ResultYahooTotal  = TotalYahoo;
            return(this.g_result);
        }
예제 #2
0
 public StructuredResult GetTheResults()
 {
     Collection<StructuredResultElement> ResultItems = new Collection<StructuredResultElement>();
     int TotalGoogle = 0;
     int TotalLive = 0;
     int TotalYahoo = 0;
     // We check if the google search option is enabled
     if (this.g_google)
     {
         // We check if this is a Google Hack Query and whether the Google Hack option is enabled or not
         if ((this.g_query.QueryGoogleHack && this.g_ggh) || (!this.g_query.QueryGoogleHack))
         {
             Api_G the_obj = new Api_G(this.g_gkey, this.g_query.QueryString, this.g_query.QueryStart, this.g_query.QueryLength, this.g_gaura);
             StructuredEngineResult resultitem = the_obj.GetResults();
             TotalGoogle = resultitem.ResultTotal;
             foreach (StructuredResultElement res_itm in resultitem.ResultItems) ResultItems.Add(res_itm);
         }
     }
     // We check if the MSN Live search option is enaled
     if (this.g_live)
     {
         // We check if this is a Google Hack Query and whether the Google Hack option is enabled or not
         if ((this.g_query.QueryGoogleHack && this.g_lgh) || (!this.g_query.QueryGoogleHack))
         {
             Api_L the_obj = new Api_L(this.g_lkey, this.g_query.QueryString, this.g_query.QueryStart, this.g_query.QueryLength);
             StructuredEngineResult resultitem = the_obj.GetResults();
             TotalLive = resultitem.ResultTotal;
             foreach (StructuredResultElement res_itm in resultitem.ResultItems) ResultItems.Add(res_itm);
         }
     }
     // We check if the Yahoo search option is enabled
     if (this.g_yahoo)
     {
         // We check if this is a Google Hack Query and whether the Google Hack option is enabled or not
         if ((this.g_query.QueryGoogleHack && this.g_ygh) || (!this.g_query.QueryGoogleHack))
         {
             Api_Y the_obj = new Api_Y(this.g_ykey, this.g_query.QueryString, this.g_query.QueryStart, this.g_query.QueryLength);
             StructuredEngineResult resultitem = the_obj.GetResults();
             TotalYahoo = resultitem.ResultTotal;
             foreach (StructuredResultElement res_itm in resultitem.ResultItems) ResultItems.Add(res_itm);
         }
     }
     g_result.ResultStart = g_query.QueryStart;
     g_result.ResultEnd = g_query.QueryLength;
     g_result.ResultQueryString = g_query.QueryString;
     g_result.ResultTotal = TotalGoogle + TotalLive + TotalYahoo;
     g_result.ResultItems = ResultItems;
     g_result.ResultGoogleTotal = TotalGoogle;
     g_result.ResultLiveTotal = TotalLive;
     g_result.ResultYahooTotal = TotalYahoo;
     return this.g_result;
 }