Esempio n. 1
0
        /// <summary>
        /// Gets the share profile.
        /// </summary>
        /// <param name="symbol">The y symbol.</param>
        /// <returns></returns>
        public void UploadShareProfileFromYahoo(string symbol)
        {
            SettingBLL settingBLL = new SettingBLL(_unit);


            Share s = _sBLL.GetShareBySymbol(symbol);

            try
            {
                // Load profile info
                string urlTemplate = settingBLL.GetSetting(Shared.SettingKey.YahooProfileUrl);
                string url         = string.Format(urlTemplate, symbol);

                if (!string.IsNullOrEmpty(url))
                {
                    HtmlWeb      web = new HtmlWeb();
                    HtmlDocument doc = web.Load(url);

                    if (doc != null)
                    {
                        //Process HTML Doc
                        this.ExtractProfileEntityFromHtmlDoc(s, doc);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(_log, ex.ToString());
                throw;
            }

            //return shareInfo;
        }