/// <summary> /// 获取竞猜工资 /// </summary> public static void getJingcaiMoney(Dictionary <String, String> cookies, Action <String> success, Action <String> error) { Thread thread = new Thread(delegate() { Thread.Sleep(1000); BaseHttpRequest baseRequest = new BaseHttpRequest(); baseRequest.Get("http://www.ji7.com/vip/get_jingcai_gongzi") .SetHeader("http://www.ji7.com/pc", null, "text/html, */*; q=0.01", null) .setCookies(cookies) .OnSuccess(result => { var zipStream = new System.IO.Compression.GZipStream(result, System.IO.Compression.CompressionMode.Decompress); StreamReader streamReader = new StreamReader(zipStream, Encoding.UTF8); string html = streamReader.ReadToEnd(); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(html); HtmlNode node = doc.DocumentNode.SelectSingleNode("//span[@class='red1']"); String money = node.InnerText; success(money); baseRequest.close(); }) .OnFail(errorText => { error(errorText); }).Go(); }); thread.Start(); }
/// <summary> /// 获取到开奖信息 /// </summary> /// <param name="cookies"></param> /// <param name="success"></param> /// <param name="error"></param> public static void open(Dictionary <String, String> cookies, Action <Dictionary <String, Object> > success, Action <String> error) { Thread thread = new Thread(delegate() { Thread.Sleep(1000); BaseHttpRequest baseRequest = new BaseHttpRequest(); baseRequest.Get("http://www.ji7.com/pc/open") .SetHeader("http://www.ji7.com/pc", null, "application/json, text/javascript, */*; q=0.01", null) .setCookies(cookies) .OnSuccess(result => { var zipStream = new System.IO.Compression.GZipStream(result, System.IO.Compression.CompressionMode.Decompress); StreamReader streamReader = new StreamReader(zipStream, Encoding.UTF8); string html = streamReader.ReadToEnd(); Dictionary <String, Object> dic = JsonToObject.jsonToDictionary(html); success(dic); baseRequest.close(); }) .OnFail(errorText => { error(errorText); }).Go(); }); thread.Start(); }
/// <summary> /// 获取昨日盈亏 /// </summary> public static void getYesterdayProfitAndLoss(Dictionary <String, String> cookies, Action <List <String> > success, Action <String> error) { Thread thread = new Thread(delegate() { Thread.Sleep(1000); BaseHttpRequest baseRequest = new BaseHttpRequest(); baseRequest.Get("http://www.ji7.com/pc/myList") .SetHeader("http://www.ji7.com/pc", null, "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", null) .setCookies(cookies) .OnSuccess(result => { var zipStream = new System.IO.Compression.GZipStream(result, System.IO.Compression.CompressionMode.Decompress); StreamReader streamReader = new StreamReader(zipStream, Encoding.UTF8); string html = streamReader.ReadToEnd(); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(html); HtmlNode node = doc.DocumentNode.SelectSingleNode("//div[@class='fr chart_all']"); String toDay = node.ChildNodes[1].ChildNodes[1].ChildNodes[1].InnerText; String money = node.ChildNodes[1].ChildNodes[3].ChildNodes[1].InnerText; HtmlNode htmlNode = doc.DocumentNode.SelectSingleNode("//table[@class='compe_table1']"); HtmlNodeCollection nodeCollection = htmlNode.ChildNodes; String msg = ""; foreach (HtmlNode n in nodeCollection) { if (n.InnerText.Contains("已开奖")) { String no = n.ChildNodes[1].InnerText; String proportion = n.ChildNodes[13].InnerText; msg = String.Format("第{0}期的盈亏比例为:{1}", no, proportion); break; } } success(new List <string>() { toDay, money, msg }); baseRequest.close(); }) .OnFail(errorText => { error(errorText); }).Go(); }); thread.Start(); }
/// <summary> /// 获取自动竞猜模式 /// </summary> public static void getAutoSetParameter(Dictionary <String, String> cookies, Action <List <String> > success, Action <String> error) { Thread thread = new Thread(delegate() { Thread.Sleep(1000); BaseHttpRequest baseRequest = new BaseHttpRequest(); baseRequest.Get("http://www.ji7.com/pc/autoSet") .SetHeader("http://www.ji7.com/pc", null, "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", null) .setCookies(cookies) .OnSuccess(result => { var zipStream = new System.IO.Compression.GZipStream(result, System.IO.Compression.CompressionMode.Decompress); StreamReader streamReader = new StreamReader(zipStream, Encoding.UTF8); string html = streamReader.ReadToEnd(); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(html); List <String> list = new List <string>(); HtmlNode node = doc.DocumentNode.SelectSingleNode("//select[@id='tbID']"); foreach (HtmlNode item in node.ChildNodes) { if (item.Name.Contains("option")) { list.Add(item.Attributes[0].Value); } } HtmlNode htmlNode = doc.DocumentNode.SelectSingleNode("//input[@id='startNO']"); list.Add(htmlNode.Attributes[4].Value); success(list); baseRequest.close(); }) .OnFail(errorText => { error(errorText); }).Go(); }); thread.Start(); }
/// <summary> /// 获取用户信息 -- U豆 /// </summary> public static void userInfo(Dictionary <String, String> cookies, Action <Dictionary <String, Object> > success, Action <String> error) { Thread thread = new Thread(delegate() { Thread.Sleep(1000); BaseHttpRequest baseRequest = new BaseHttpRequest(); baseRequest.Get("http://www.ji7.com/") .SetHeader("http://www.ji7.com/", null, "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", null) .setCookies(cookies) .OnSuccess(result => { var zipStream = new System.IO.Compression.GZipStream(result, System.IO.Compression.CompressionMode.Decompress); StreamReader streamReader = new StreamReader(zipStream, Encoding.UTF8); string html = streamReader.ReadToEnd(); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(html); HtmlNode node = doc.DocumentNode.SelectSingleNode("//input[@id='userid']"); String userid = node.Attributes[3].Value; HtmlNodeCollection collection = doc.DocumentNode.SelectNodes("//i[@class='fl acc_price']"); HtmlNode ubiNode = collection[0]; HtmlNode udouNode = collection[1]; Dictionary <String, Object> dic = new Dictionary <String, Object>(); dic.Add("userid", userid); dic.Add("user_udou", udouNode.InnerText); dic.Add("user_ubi", ubiNode.InnerText); dic.Add("msg", "用户数据获取成功!"); dic.Add("status", 0); success(dic); baseRequest.close(); }) .OnFail(errorText => { error(errorText); }).Go(); }); thread.Start(); }