Пример #1
0
        public BbLMB(DateTime today)
            : base(ESport.Baseball_LMB)
        {
            // 設定
            this.AllianceID = 72;
            this.GameType = "BBMX2";
            //this.GameDate = GetUtcUsaEt(today).Date; // 只取日期
            int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            if (diffTime > 0)
                this.GameDate = today.AddHours(-diffTime);
            else
                this.GameDate = GetUtcUsaEt(today);//取得美東時間

            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://www.milb.com/lookup/json/named.schedule_vw_complete.bam?game_date='{0}'&season={1}&league_id=125";
            }
            if (string.IsNullOrWhiteSpace(this.sWebUrl1))
            {
                this.sWebUrl1 = @"http://www.milb.com/gdcross/components/game/aaa/year_{0}/month_{1}/day_{2}/{3}/linescore.json";
            }

            this.DownHome = new BasicDownload(this.Sport, string.Format(this.sWebUrl,this.GameDate.ToString("yyyy/MM/dd").Replace("-", "/"),this.GameDate.ToString("yyyy")));
            this.DownReal = new Dictionary<string, BasicDownload>();
        }
Пример #2
0
        public BbMLB(DateTime today)
            : base(ESport.Baseball_MLB)
        {
            // 設定
            this.AllianceID = 53;
            this.GameType = "BBUS";
            //this.GameDate = GetUtcUsaEt(today).Date; // 只取日期
            int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            if (diffTime > 0)
                this.GameDate = today.AddHours(-diffTime);
            else
                this.GameDate = GetUtcUsaEt(today);//取得美東時間

            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://www.cbssports.com/mlb/scoreboard";
            }
            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
            //this.DownHome = new BasicDownload(this.Sport, string.Format(@"http://mlb.mlb.com/gdcross/components/game/mlb/year_{0}/month_{1}/day_{2}/master_scoreboard.json", this.GameDate.ToString("yyyy"), this.GameDate.ToString("MM"), this.GameDate.ToString("dd")));
            this.DownWeb = new WebBrowser();
            this.DownWeb.AllowNavigation = false;
            this.DownWeb.AllowWebBrowserDrop = false;
            this.DownWeb.ScriptErrorsSuppressed = true;
            this.DownWeb.IsWebBrowserContextMenuEnabled = false;
            this.DownWeb.ScrollBarsEnabled = false;
            this.DownWeb.WebBrowserShortcutsEnabled = false;
            this.DownWeb.TabStop = false;
            this.DownWeb.Tag = this.sWebUrl;
        }
Пример #3
0
        public DaqiuData(DateTime today)
            : base(ESport.DaQiuData)
        {
            //读取队伍配置信息
            this.AllianceID = 0;
            this.GameType = "PKJQ";
            this.GameDate = today.Date; // 只取日期

            this.DownCorner = new BasicDownload(this.Sport, corner);

            //获取打球比分网址
            string gamedate = DateTime.Now.ToString("yyyy-MM-dd");
            string gamecode = EasyEncryption(gamedate, true);
            //this.LastLogTime = DateTime.Now;
            string url = this.score + "?GameDate=" + gamedate + "&GameType=" + 10 + "&GameCode=" +
                         gamecode;
            this.DownScore = new BasicDownload(this.Sport, url);

            //根据下载球类拼接网址,放到 list。或者你可以用 ConcurrentDictionary
            //参照 Football.cs  54行
            DownTs = new List<BasicDownload>();

            DownTsRecordSource = new List<BasicDownload>();

            DownTsFloatSource = new List<BasicDownload>();

            //加载足球对应队伍
            LoadXml(UrlSetting.GetUrl(ESport.DaQiuData, "FoolballCornerPath"));
        }
Пример #4
0
 public BkACB(DateTime today)
     : base(ESport.Basketball_ACB)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl=@"http://d.asiascore.com/x/feed/f_3_0_8_asia_1";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl1))
     {
         this.sWebUrl1 = "http://d.asiascore.com/x/feed/proxy";
     }
     // 設定
     this.AllianceID = 27;
     this.GameType = "BKACB";
     this.GameDate = GetUtcTw(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
     this.DownHomeHeader = new Dictionary<string, string>();
     this.DownHomeHeader["Accept"] = "*/*";
     this.DownHomeHeader["Accept-Charset"] = "utf-8;q=0.7,*;q=0.3";
     this.DownHomeHeader["Accept-Encoding"] = "gzip,deflate,sdch";
     this.DownHomeHeader["Accept-Language"] = "*";
     this.DownHomeHeader["X-Fsign"] = "SW9D1eZo";
     this.DownHomeHeader["X-GeoIP"] = "1";
     this.DownHomeHeader["X-utime"] = "1";
     this.DownHomeHeader["Cookie"] = "__utma=190588603.635099785.1357704170.1360998879.1361003436.71; __utmb=190588603.1.10.1361003436; __utmc=190588603; __utmz=190588603.1361003436.71.19.utmcsr=asiascore.com|utmccn=(referral)|utmcmd=referral|utmcct=/";
     this.DownHomeHeader["Host"] = "d.asiascore.com";
     this.DownHomeHeader["Referer"] = this.sWebUrl1;
     //this.DownRealHeader["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17";
     //this.DownRealHeader["Connection"] = "keep-alive";
 }
Пример #5
0
        private string sWebUrl3 = UrlSetting.GetUrl(ESport.Baseball_CPBL, "Url3"); //全局

        #endregion Fields

        #region Constructors

        public BbCPBL(DateTime today)
            : base(ESport.Baseball_CPBL)
        {
            // 設定
            this.AllianceID = 30;
            this.GameType = "BBTW";
            this.GameDate = GetUtcTw(today).Date; // 只取日期
            //this.DownHome = new BasicDownload(this.Sport, @"http://www.cpbl.com.tw/Standings/AllScoreqry.aspx?gamekind=01&myfield=F00&mon=3&qyear=2012");

            #region 来源网设定
            //如果xml中没有配置就使用下面的默认地址
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = "http://www.cpbl.com.tw/standings/Allscoreqry.aspx";
            }
            if (string.IsNullOrWhiteSpace(sWebUrl1))
            {
                sWebUrl1 = "http://online.cpbl.com.tw/online2010/ScoreBoard.aspx?gameno=01&pbyear={0}&game={1}";
            }
            if (string.IsNullOrWhiteSpace(sWebUrl2))
            {
                sWebUrl2 = "http://online.cpbl.com.tw/online2010/Inner.aspx?gameno=01&pbyear={0}&game={1}";
            }
            if (string.IsNullOrWhiteSpace(sWebUrl3))
            {
                sWebUrl3 = "http://online.cpbl.com.tw/online2010/Game.aspx?gameno=01&pbyear={0}&game={1}";
            }
            #endregion

            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
            this.DownReal = new Dictionary<string, BasicDownload>();
        }
Пример #6
0
 public BkEBT(DateTime today)
     : base(ESport.Basketball_EBT)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://d.flashscore.com/x/feed/f_3_0_8_asia_1";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl1))
     {
         this.sWebUrl1 = "http://d.flashscore.com/x/feed/proxy";
     }
     // 設定
     this.AllianceID = 23;
     this.GameType = "BKEBT";
     this.GameDate = GetUtcTw(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
     this.DownHomeHeader = new Dictionary<string, string>();
     this.DownHomeHeader["Accept"] = "*/*";
     this.DownHomeHeader["Accept-Charset"] = "utf-8;q=0.7,*;q=0.3";
     this.DownHomeHeader["Accept-Encoding"] = "gzip,deflate,sdch";
     this.DownHomeHeader["Accept-Language"] = "*";
     this.DownHomeHeader["X-Fsign"] = "SW9D1eZo";
     this.DownHomeHeader["X-GeoIP"] = "1";
     this.DownHomeHeader["X-utime"] = "1";
     this.DownHomeHeader["Cookie"] = "__utma=175935605.237435887.1433729535.1433729535.1433732345.2; __utmb=175935605.4.10.1433732345; __utmc=175935605; __utmz=175935605.1433732345.2.2.utmcsr=flashscore.com|utmccn=(referral)|utmcmd=referral|utmcct=/tennis/; __utmt=1; __gads=ID=95d4003915b743c6:T=1433729537:S=ALNI_MYpkSaA3-m9gggcZp-An3QTk6uUOg";
     this.DownHomeHeader["Host"] = "d.flashscore.com";
     this.DownHomeHeader["Referer"] = this.sWebUrl1;
     //this.DownRealHeader["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17";
     //this.DownRealHeader["Connection"] = "keep-alive";
 }
Пример #7
0
        public IhAHL(DateTime today)
            : base(ESport.Hockey_AHL)
        {
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://theahl.com/stats/schedule.php?date=";
            }
            // 設定
            this.AllianceID = 21;
            this.GameType = "IHUS2";

            if (today.Date == DateTime.Now.Date)//以現在時間為基準去切換美東時間
            {
                diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
                if (diffTime > 0)
                    this.GameDate = today.AddHours(-diffTime);
                else
                    this.GameDate = GetUtcUsaEt(today);//取得美東時間
            }
            else
                this.GameDate = today;//手動指定時間

            //this.DownHome = new BasicDownload(this.Sport, @"http://theahl.com/stats/schedule.php"); // 以網站的資料頁面為主
            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl + this.GameDate.ToString("yyyy-MM-dd"));
        }
Пример #8
0
        public BbMLB3(DateTime today)
            : base(ESport.Baseball_MLB3)
        {
            // 設定
            this.AllianceID = 53;
            this.GameType = "BBUS";
            this.GameDate = today.Date; // 只取日期

            // 運彩 Url 參數: aid=1 (賽事種類: 韓國職棒) gamedate (時間: yyyyMMdd) mode=11 (盤口: 國際)
            string url = String.Format(@"http://www.playsport.cc/livescore.php?aid=1&gamedate={0:yyyyMMdd}&mode=11", this.GameDate);
            this.DownReal = new BasicDownload(this.Sport, url, Encoding.GetEncoding("big5"));
        }
Пример #9
0
 public BkKBL(DateTime today)
     : base(ESport.Basketball_KBL)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://basket2.7m.cn/DataFile/S2_fbig1.js";
     }
     // 設定
     this.AllianceID = 14;
     this.GameType = "BKKR";
     this.GameDate = GetUtcKr(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, sWebUrl);
 }
Пример #10
0
 public BkKBLBet007(DateTime today)
     : base(ESport.Basketball_KBL)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://interface.win007.com/lq/today.aspx";
     }
     // 設定
     this.AllianceID = 14;
     this.GameType = "BKKR";
     this.GameDate = GetUtcKr(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl, Encoding.UTF8);
 }
Пример #11
0
 public BbMLB2(DateTime today)
     : base(ESport.Baseball_MLB2)
 {
     //清空
     this.Dispose();
     // 設定
     this.AllianceID = 53;
     this.GameType = "BBUS";
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://scores.espn.go.com/mlb/scoreboard";
     }
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
 }
Пример #12
0
 public BkWKBLBet007(DateTime today)
     : base(ESport.Basketball_WKBL)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://interface.win007.com/lq/today.aspx";
     }
     // 設定
     this.AllianceID = 15;
     this.GameType = "BKKRW";
     this.GameDate = GetUtcTw(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl, Encoding.UTF8);
     //this.DownHome = new BasicDownload(this.Sport, @"http://dxbf.bet007.com/nba_date.aspx?time=2013-11-10", Encoding.GetEncoding("gb2312"));
 }
Пример #13
0
 public BbCPBL2(DateTime today)
     : base(ESport.Baseball_CPBL2)
 {
     // 設定
     this.AllianceID = 30;
     this.GameType = "BBTW";
     this.GameDate = today.Date; // 只取日期
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = "http://www.playsport.cc/livescore.php?aid=6&gamedate={0:yyyyMMdd}&mode=11";
     }
     // 運彩 Url 參數: aid=6 (賽事種類: 中華職棒) gamedate (時間: yyyyMMdd) mode=11 (盤口: 國際)
     string url = String.Format(this.sWebUrl, this.GameDate);
     this.DownReal = new BasicDownload(this.Sport, url, Encoding.GetEncoding("big5"));
 }
Пример #14
0
 public BbNPB3(DateTime today)
     : base(ESport.Baseball_NPB3)
 {
     // 設定
     this.AllianceID = 46;
     this.GameType = "BBJP";
     this.GameDate = today.Date; // 只取日期
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://tslc.stats.com/npb/scoreboard.asp?day={0}&&ref=OFF";
     }
     //尬球乐 日棒
     string url = String.Format(this.sWebUrl, this.GameDate.ToString("yyyyMMdd"));
     this.DownReal = new BasicDownload(this.Sport, url, Encoding.GetEncoding("GB2312"));
 }
Пример #15
0
 public BBKBO3(DateTime today)
     : base(ESport.Baseball_KBO3)
 {
     if (string.IsNullOrWhiteSpace(sWebUrl))
     {
         sWebUrl = "http://data.cast.sports.media.daum.net/bs/kbo/{0}|{1}";
     }
     // 設定
     this.AllianceID = 66;
     this.GameType = "BBKR";
     this.GameDate = today.Date; // 只取日期
     //获取来源网id
     List<string> list = getWebID();
     // 運彩 Url 參數: aid=9 (賽事種類: 韓國職棒) gamedate (時間: yyyyMMdd) mode=11 (盤口: 國際)
     string url = String.Format(this.sWebUrl, list.Count > 0 ? list[0] : "", this.GameDate.ToString("yyyy"));
     this.DownHome = new BasicDownload(this.Sport, url);
 }
Пример #16
0
        public BkNBA(DateTime today)
            : base(ESport.Basketball_NBA)
        {
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://insider.espn.go.com/nba/caster/realtime";
            }
            if (string.IsNullOrWhiteSpace(this.sWebUrl1))
            {
                this.sWebUrl1 = @"http://scores.espn.go.com/nba/scoreboard";
            }
            // 設定
            this.AllianceID = 1;
            this.GameType = "BKUS";
            int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            if (diffTime > 0)
                this.GameDate = today.AddHours(-diffTime);
            else
                this.GameDate = GetUtcUsaEt(today);//取得美東時間

            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);

            this.DownReal = new BasicDownload(this.Sport, this.sWebUrl1);

            this.DownWeb = new WebBrowser();
            this.DownWeb.AllowNavigation = false;
            this.DownWeb.AllowWebBrowserDrop = false;
            this.DownWeb.ScriptErrorsSuppressed = false;
            this.DownWeb.IsWebBrowserContextMenuEnabled = false;
            this.DownWeb.ScrollBarsEnabled = false;
            this.DownWeb.WebBrowserShortcutsEnabled = false;
            this.DownWeb.TabStop = false;
            this.DownWeb.Tag = this.sWebUrl;

            this.DownWebScores = new WebBrowser();
            this.DownWebScores.AllowNavigation = false;
            this.DownWebScores.AllowWebBrowserDrop = false;
            this.DownWebScores.ScriptErrorsSuppressed = false;
            this.DownWebScores.IsWebBrowserContextMenuEnabled = false;
            this.DownWebScores.ScrollBarsEnabled = false;
            this.DownWebScores.WebBrowserShortcutsEnabled = false;
            this.DownWebScores.TabStop = false;
            this.DownWebScores.Tag = this.sWebUrl1;
        }
Пример #17
0
        public BbKBO(DateTime today)
            : base(ESport.Baseball_KBO)
        {
            // 設定
            this.AllianceID = 66;
            this.GameType = "BBKR";
            this.GameDate = GetUtcKr(today).Date; // 只取日期

            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://sports.news.naver.com/schedule/index.nhn?category=kbo";
            }
            if (string.IsNullOrWhiteSpace(this.sWebUrl1))
            {
                this.sWebUrl1 = @"http://sportsdata.naver.com/ndata/kbo/{0}/{1}/{2}.nsd";
            }
            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
            this.DownReal = new Dictionary<string, BasicDownload>();
        }
Пример #18
0
        public Football(DateTime today)
            : base(ESport.Football)
        {
            //XML无来源网配置 取默认
            if (string.IsNullOrWhiteSpace(spboUrl))
            {
                spboUrl = @"http://bf.spbo.com/";
            }
            if (string.IsNullOrWhiteSpace(yesterdayUrl))
            {
                yesterdayUrl = @"http://www.spbo.com/end0.htm";
            }
            if (string.IsNullOrWhiteSpace(tomorrowUrl))
            {
                tomorrowUrl = @"http://www.spbo.com/new";
            }
            // 設定
            this.AllianceID = 0;
            this.GameType = "SB";
            this.GameDate = today.Date; // 只取日期
            this.DownHome = new BasicDownload(this.Sport, spboUrl);
            this.DownHomeData = new List<BasicDownload>();

            this.DownReal = new List<BasicDownload>();
            // 昨天
            //this.DownReal.Add(new BasicDownload(this.Sport, @"http://www8.spbo.com/history.plex?day=&l=cn2"));
            this.DownReal.Add(new BasicDownload(this.Sport, yesterdayUrl, Encoding.GetEncoding(936)));  // 原昨日跟分網址因賽事資料有落差 改跟此網頁資料
            //來源網domain被綁架,暫時使用備用來源 http://www8.spbo1.com/

            // 往後 7 天
            for (int i = 0; i < 7; i++)
            {
                this.DownReal.Add(new BasicDownload(this.Sport, tomorrowUrl + i + ".htm", Encoding.GetEncoding(936))); // gb2312
                //來源網domain被綁架,暫時使用備用來源 http://www.spbo1.com/
            }

            //this.DownAnalysisData = new ConcurrentDictionary<string, BasicDownload>();
            this.DownAnalysisData = new ConcurrentDictionary<string, BasicDownload>();
            this.AlreadyEndingData = new List<string>();

            GetOldData();
        }
Пример #19
0
        public BbABL(DateTime today)
            : base(ESport.Baseball_ABL)
        {
            // 設定
            this.AllianceID = 104;
            this.GameType = "BBAU";
            //int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            //if (diffTime > 0)
            this.GameDate = today.AddHours(2);//澳洲 时间
            //else
            //    this.GameDate = GetUtcUsaEt(today);//

            //如果没有配置就使用默认来源网
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = "http://web.theabl.com.au/gdcross/components/game/win/year_{0}/month_{1}/day_{2}/master_scoreboard.xml";
            }

            this.DownHome = new BasicDownload(this.Sport, string.Format(this.sWebUrl, this.GameDate.ToString("yyyy"), this.GameDate.ToString("MM"), this.GameDate.ToString("dd")));
        }
Пример #20
0
 public BkWKBL(DateTime today)
     : base(ESport.Basketball_WKBL)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://www.wkbl.or.kr//include/header_game.asp";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl1))
     {
         this.sWebUrl1 = @"http://www.wkbl.or.kr/live11/path_live_player.asp?ckey={0}|{1}|{2}|";
     }
     // 設定
     this.AllianceID = 15;
     this.GameType = "BKKRW";
     this.GameDate = GetUtcKr(today).Date; // 只取日期
     //this.DownHome = new BasicDownload(this.Sport, @"http://www.wkbl.or.kr/main/main.asp", Encoding.GetEncoding(949));
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl, Encoding.UTF8);
     //this.DownHome.Proxy = Proxy;
     this.DownReal = new Dictionary<string, BasicDownload>();
 }
Пример #21
0
 public BkEuroleagueBet007(DateTime today)
     : base(ESport.Basketball_Euroleague)
 {
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://interface.win007.com/lq/today.aspx";
     }
     // 設定
     this.AllianceID = 13;
     this.GameType = "BKEL";
     this.GameDate = GetUtcTw(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl, Encoding.UTF8);
     //this.DownHomeHeader = new Dictionary<string, string>();
     //this.DownHomeHeader["Accept"] = "*/*";
     //this.DownHomeHeader["Accept-Charset"] = "gb2312";
     //this.DownHomeHeader["Accept-Encoding"] = "gzip, deflate";
     //this.DownHomeHeader["Host"] = "dxbf.bet007.com";
     //this.DownHomeHeader["User-Agent"] = "User-Agent	Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)";
     //this.DownHomeHeader["Connection"] = "keep-alive";
 }
Пример #22
0
 public BbNPB(DateTime today)
     : base(ESport.Baseball_NPB)
 {
     // 設定
     this.AllianceID = 46;
     this.GameType = "BBJP";
     this.GameDate = GetUtcJp(today).Date; // 只取日期
     #region 来源网设定
     if (string.IsNullOrWhiteSpace(this.sWebUrl))
     {
         this.sWebUrl = @"http://baseball.yahoo.co.jp/npb/schedule/";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl1))
     {
         this.sWebUrl1 = @"http://baseball.yahoo.co.jp/npbopen/schedule/";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl2))
     {
         this.sWebUrl2 = @"http://baseball.yahoo.co.jp/npbopen/game/{0}/top";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl3))
     {
         this.sWebUrl3 = @"http://baseball.yahoo.co.jp/npbopen/game/{0}/stats";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl4))
     {
         this.sWebUrl4 = @"http://live.baseball.yahoo.co.jp/npbopen/game/{0}/score";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl5))
     {
         this.sWebUrl5 = @"http://baseball.yahoo.co.jp/npb/game/{0}/top";
     }
     if (string.IsNullOrWhiteSpace(this.sWebUrl6))
     {
         this.sWebUrl6 = @"http://live.baseball.yahoo.co.jp/npb/game/{0}/score";
     }
     #endregion
     this.DownHome = new BasicDownload(this.Sport, this.sWebUrl);
     this.DownHomeWarmUp = new BasicDownload(this.Sport, this.sWebUrl1);
     this.DownReal = new Dictionary<string, BasicDownload>();
 }
Пример #23
0
        public BkNCAA(DateTime today)
            : base(ESport.Basketball_NCAA)
        {
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://data.ncaa.com/jsonp/scoreboard/basketball-men/d1/{0}/{1:00}/{2:00}/scoreboard.html";
            }
            // 設定
            this.AllianceID = 30;
            this.GameType = "BKNCAA";
            int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            if (diffTime > 0)
                this.GameDate = today.AddHours(-diffTime);
            else
                this.GameDate = GetUtcUsaEt(today);//取得美東時間

            string url = String.Format(this.sWebUrl,
                this.GameDate.Year, this.GameDate.Month, this.GameDate.Day);

            this.DownHome = new BasicDownload(this.Sport, url);
        }
Пример #24
0
        public BkWNBA(DateTime today)
            : base(ESport.Basketball_WNBA)
        {
            this.Logs = new LogFile(ESport.Basketball_WNBA);//設定log type
            if (string.IsNullOrWhiteSpace(this.sWebUrl))
            {
                this.sWebUrl = @"http://scores.espn.go.com/wnba/scoreboard";
            }
            if (string.IsNullOrWhiteSpace(this.sWebUrl1))
            {
                this.sWebUrl1 = @"http://espn.go.com/wnba/boxscore?gameId={0}";
            }
            // 設定
            this.AllianceID = 19;
            this.GameType = "BKUSW";
            int diffTime = frmMain.GetGameSourceTime("EasternTime");//取得與當地時間差(包含日光節約時間)
            if (diffTime > 0)
                this.GameDate = today.AddHours(-diffTime);
            else
                this.GameDate = GetUtcUsaEt(today);//取得美東時間

            this.DownHome = new BasicDownload(this.Sport, this.sWebUrl); // 以網站的資料頁面為主
            this.DownScore = new Dictionary<string, BasicDownload>();
        }
Пример #25
0
 public IhKHL(DateTime today)
     : base(ESport.Hockey_KHL)
 {
     // 設定
     this.AllianceID = 18;
     this.GameType = "IHRU";
     this.GameDate = GetUtcRu(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, @"http://d.asiascore.com/x/feed/f_4_0_8_asia_1");
     this.DownHomeHeader = new Dictionary<string, string>();
     this.DownHomeHeader["Accept"] = "*/*";
     this.DownHomeHeader["Accept-Charset"] = "utf-8;q=0.7,*;q=0.3";
     this.DownHomeHeader["Accept-Encoding"] = "gzip,deflate,sdch";
     this.DownHomeHeader["Accept-Language"] = "*";
     this.DownHomeHeader["X-Fsign"] = "SW9D1eZo";
     this.DownHomeHeader["X-GeoIP"] = "1";
     this.DownHomeHeader["X-utime"] = "1";
     this.DownHomeHeader["Cookie"] = "__utma=190588603.635099785.1357704170.1360998879.1361003436.71; __utmb=190588603.1.10.1361003436; __utmc=190588603; __utmz=190588603.1361003436.71.19.utmcsr=asiascore.com|utmccn=(referral)|utmcmd=referral|utmcct=/";
     this.DownHomeHeader["Host"] = "d.asiascore.com";
     this.DownHomeHeader["Referer"] = "http://d.asiascore.com/x/feed/proxy";
     //this.DownRealHeader["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17";
     //this.DownRealHeader["Connection"] = "keep-alive";
     //this.DownHome = new BasicDownload(this.Sport, @"http://en.khl.ru/calendar/");
     this.DownReal = new Dictionary<string, BasicDownload>();
 }
Пример #26
0
        public BkBJ(DateTime today)
            : base(ESport.Basketball_BJ)
        {
            // 設定
            this.AllianceID = 10;
            this.GameType = "BKJP";
            this.GameDate = GetUtcJp(today).Date; // 只取日期
            this.DownHome = new BasicDownload(this.Sport, @"http://www.bj-league.com/");
            this.DownReal = new Dictionary<string, string[]>();
            #region
            //CookieContainer cc = new CookieContainer();
            //string url = "https://www.basketballjapantv.com/logins/login";
            //HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            //request.Method = "POST";
            //request.ContentType = "application/x-www-form-urlencoded";
            //cc.Add(new Cookie("PHPSESSID","ubot579m9ehssok33d6spl71c0"));
            //cc.Add(new Cookie("__ulfpc", "201412151109329186_f"));
            //cc.Add(new Cookie("__utmc", "145334439"));
            //cc.Add(new Cookie("__utma", "145334439.376807439.1418609418.1418624249.1418634144.4"));
            //cc.Add(new Cookie("__utmz", "145334439.1418609418.1.1.utmcsr=bj-league.com|utmccn=(referral)|utmcmd=referral|utmcct=/"));
            //cc.Add(new Cookie("__utmb", "145334439.6.10.1418634144"));

            //request.CookieContainer = cc;
            //request.Accept = "text/html, application/xhtml+xml, */*";
            //request.Referer = "https://www.basketballjapantv.com/logins/login";
            //request.Host = "www.basketballjapantv.com";
            //string data = "&data%5BUser%5D%5Blogin_name%[email protected]&data%5BUser%5D%5Blogin_password%5D=qaz369&data%5BUser%5D%5Bremember_me%5D=0&x=49&y=24";
            //request.ContentLength = data.Length;
            ////StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.UTF8);
            ////writer.Write(data);
            ////writer.Flush();
            //request.UserAgent = @"Mozilla/5.0 (Windows; U; Windows NT 5.2; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 4.0.20506)";
            //Encoding encoding = Encoding.UTF8;//根据网站的编码自定义
            //byte[] postData = encoding.GetBytes(data);//postDataStr即为发送的数据
            //request.ContentLength = postData.Length;
            //Stream requestStream = request.GetRequestStream();
            //requestStream.Write(postData, 0, postData.Length);

            //HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            //Stream responseStream = response.GetResponseStream();
            //StreamReader streamReader = new StreamReader(responseStream, encoding);
            //string retString = streamReader.ReadToEnd();

            //Uri u= new Uri("http://www.basketballjapantv.com/files/xml/play_by_play/games/2014121301/status.json");

            //streamReader.Close();
            //responseStream.Close();

            //string postString = "&data%5BUser%5D%5Blogin_name%[email protected]&data%5BUser%5D%5Blogin_password%5D=qaz369&data%5BUser%5D%5Bremember_me%5D=0&x=49&y=24";//这里即为传递的参数,可以用工具抓包分析,也可以自己分析,主要是form里面每一个name都要加进来
            //byte[] postData = Encoding.UTF8.GetBytes(postString);//编码,尤其是汉字,事先要看下抓取网页的编码方式
            //string url = "https://www.basketballjapantv.com/logins/login";//地址
            //WebClient webClient = new WebClient();
            //webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");//采取POST方式必须加的header,如果改为GET方式的话就去掉这句话即可
            //byte[] responseData = webClient.UploadData(url, "POST", postData);//得到返回字符流
            //string srcString = Encoding.UTF8.GetString(responseData);//解码
            #endregion

            //
            GetCookieContainer();

            //获取帐号
            loginUser = frmMain.bkbj_user.Trim().Split(',');
            loginPwd = frmMain.bkbj_pwd.Trim().Split(',');
        }
Пример #27
0
 public BkKBL_NV(DateTime today)
     : base(ESport.Basketball_KBL)
 {
     // 設定
     this.AllianceID = 14;
     this.GameType = "BKKR";
     this.GameDate = GetUtcKr(today).Date; // 只取日期
     this.DownHome = new BasicDownload(this.Sport, @"http://sports.news.naver.com/sports/index.nhn?category=kbl&ctg=schedule", Encoding.GetEncoding(949));
     this.DownReal = new Dictionary<string, BasicDownload>();
 }