Beispiel #1
0
        internal static bool UpdateSearchHistory(string connString, KeyWordInfo keyWord)
        {
            DataTable           dataTable       = SQLExtension.GetDataTableFromStoredProcedure(connString: connString, storedProcedureName: "[qwi].[GG.UpdateSearchHistory]", parameters: keyWord.SQLParametersForHistory);
            SQLResultStatusInfo sqlResultStatus = dataTable.SerializeFirst <SQLResultStatusInfo>();

            return(sqlResultStatus.Id > 0);
        }
Beispiel #2
0
 public KeyWordDetailInfo(Result item, KeyWordInfo keyWord, Boolean isAds, Int32 page) : this()
 {
     this.IsAds       = isAds;
     this.SearchCode  = keyWord.Code;
     this.SearchKey   = keyWord.KeyWordToSearch;
     this.Page        = page;
     this.Name        = item.Title;
     this.Url         = item.HtmlFormattedUrl;
     this.Website     = item.Link;
     this.Description = item.Snippet;
     updateWebsite();
 }
Beispiel #3
0
        internal static bool UpdateVedCodeCrossLink(string connString, KeyWordInfo keyWord, Dictionary <String, String> veds)
        {
            List <KeyValuePair <String, Object> > parameters = new List <KeyValuePair <String, Object> >()
            {
                new KeyValuePair <String, Object>("@KeyWord", keyWord.KeyWordToSearch),
                new KeyValuePair <String, Object>("@DetailId", -1),
                new KeyValuePair <String, Object>("@Veds", KeyWordDetailInfo.GetVedsDataTable(veds))
            };
            DataTable           dataTable       = SQLExtension.GetDataTableFromStoredProcedure(connString: connString, storedProcedureName: "[qwi].[GG.UpdateVedCodeCrossLink]", parameters: parameters);
            SQLResultStatusInfo sqlResultStatus = dataTable.SerializeFirst <SQLResultStatusInfo>();

            return(sqlResultStatus.Id > 0);
        }
Beispiel #4
0
 public KeyWordDetailInfo(ChromeDriver driver, IWebElement element, KeyWordInfo keyWord, Boolean isAds, Int32 page) : this()
 {
     this.IsAds      = isAds;
     this.SearchCode = keyWord.Code;
     this.SearchKey  = keyWord.KeyWordToSearch;
     this.Page       = page;
     if (this.IsAds)
     {
         setPropertiesAds(driver, element);
     }
     else
     {
         setProperties(driver, element);
     }
     updateWebsite();
 }
Beispiel #5
0
        private static bool pollingVed(String connString, ChromeDriver driver, KeyWordInfo keyWord, ReadOnlyCollection <IWebElement> elements, Boolean isAds, Int32 page)
        {
            Boolean success = false;

            if (elements != null)
            {
                Dictionary <String, String> veds = new Dictionary <String, String>();
                foreach (IWebElement element in elements)
                {
                    try
                    {
                        Uri    uri = new Uri(element.GetValue("", "href"));
                        String ved = System.Web.HttpUtility.ParseQueryString(uri.Query).Get("ved");
                        veds[ved] = element.Text;
                        success   = true;
                    }
                    catch (Exception) { }
                }
                success = DataOperation.UpdateVedCodeCrossLink(connString, keyWord, veds);
                Utilities.Utilities.Log(message: success ? $"K" : "O", isWriteLine: false, addTime: false);
            }
            return(success);
        }
Beispiel #6
0
        private static bool pollingKeyWordDetails(string connString, ChromeDriver driver, KeyWordInfo keyWord, ReadOnlyCollection <IWebElement> elements, Boolean isAds, Int32 page)
        {
            Boolean success = false;

            if (elements != null)
            {
                foreach (IWebElement element in elements)
                {
                    KeyWordDetailInfo keyWordDetail = new KeyWordDetailInfo(driver, element, keyWord, isAds, page);
                    if (success = !keyWordDetail.HasError)
                    {
                        success = DataOperation.UpdateKeyWordDetail(connString, keyWordDetail);
                    }
                    Utilities.Utilities.Log(message: success ? $"." : "X", isWriteLine: false, addTime: false);
                }
            }
            return(success);
        }