Exemplo n.º 1
0
        public string GetPrice()
        {
            HTMLStrip strip = new HTMLStrip();
            string sb = "";
            sb = strip.stripHtml(strip.GetURLContent(MetalUrl, Encoding.UTF8));
            string sGold = GetGold(sb);
            string sSilver = GetSilver(sb);
            sb = sGold + sSilver;

            return sb;
        }
Exemplo n.º 2
0
 public robot_yc()
 {
     strip = new HTMLStrip();
 }
Exemplo n.º 3
0
        /// <summary>
        /// 分析新浪返回的数据
        /// </summary>
        /// <param name="sb"></param>
        /// <returns></returns>
        private string Analytics(string url)
        {
            string s = "";
            HTMLStrip strip = new HTMLStrip();
            s = strip.stripHtml(strip.GetURLContent(url, Encoding.UTF8));
            int iStart = s.IndexOf("健康指数");
            s = s.Substring(iStart);
            string[] items = s.Split(' ');
            s = title;
            const int ITEM_LEN = 5;

            for (int i = 0; i < ITEM_LEN; i++)
            {
                switch (items[i].Substring(0, 4))
                {
                    case "健康指数":
                        s += "健康指数: " + items[i].Substring(4) + "\r\n";
                        break;
                    case "商谈指数":
                        s += "商谈指数: " + items[i].Substring(4) + "\r\n";
                        break;
                    case "幸运颜色":
                        s += "幸运颜色: " + items[i].Substring(4) + "\r\n";
                        break;
                    case "幸运数字":
                        s += "幸运数字: " + items[i].Substring(4) + "\r\n";
                        break;
                    case "速配星座":
                        s += "速配星座: " + items[i].Substring(4) + "\r\n";
                        break;
                }
            }
            string data = "";
            for (int j = ITEM_LEN; j < items.Length; j++)
            {
                data += items[j];
            }
            data = data.Replace("&nbsp;", " ");
            s += data;
            return s;
        }