diff --git a/FC002AnalyTest.go b/FC002AnalyTest.go index b754a3e53a3c7f2976ceb6e3d785c96f1874883c..9d27ca0b00c3f2d34058b6e289d13c18dc8664f1 100644 --- a/FC002AnalyTest.go +++ b/FC002AnalyTest.go @@ -13,8 +13,8 @@ func main() { base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------C1模型--------------") base.Log.Info("---------------------------------------------------------------") - c1 := new(service.C3Service) - c1.MaxLetBall = 1 + c1 := new(service.C4Service) + c1.MaxLetBall = 2 c1.AnalyTest() base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------E1模型--------------") diff --git a/assets/wechat/html/today_tbs.html b/assets/wechat/html/today_tbs.html index 9cd8889b16cf6f0b0e77acb0aef09d0c511ad0b3..2f240d61c68d2324cb6756a0c818bb1edc8c2f70 100644 --- a/assets/wechat/html/today_tbs.html +++ b/assets/wechat/html/today_tbs.html @@ -23,13 +23,13 @@ 红:{{.RedCount}}, 黑:{{.BlackCount}}, 胜率:{{.RedCount}}/({{.RedCount}}+{{.BlackCount}})={{.Val}} - +
  • {{.MainAlflag}}单方向统计, 红:{{.MainRedCount}}, 黑:{{.MainBlackCount}}, 胜率:{{.MainRedCount}}/({{.MainRedCount}}+{{.MainBlackCount}})={{.MainVal}} - +

  • @@ -47,36 +47,41 @@ 主队(让球)客队 比分 推荐 - 指数 + 指数/Desc - {{if .DataList}} - {{with .DataList}} - {{range .}} - - {{.AlFlag}} - {{.MatchDateStr}} - {{.LeagueName}} - - {{if .TOVoid}}{{end}} - {{.MainTeam}}({{.LetBall}}){{.GuestTeam}} - {{if .TOVoid}}{{if .TOVoidDesc}}({{.TOVoidDesc}}){{end}}{{end}} - - - {{.MainTeamGoal}}:{{.GuestTeamGoal}} - - - {{preResultStr .PreResult .AlFlag}} - - - {{.HitCount}} - - - {{end}} +{{if .DataList}} +{{with .DataList}} +{{range .}} + + {{.AlFlag}} + {{.MatchDateStr}} + {{.LeagueName}} + + {{if .TOVoid}} + {{end}} + {{.MainTeam}}({{.LetBall}}){{.GuestTeam}} + {{if .TOVoid}}{{if .TOVoidDesc}}({{.TOVoidDesc}}){{end}}{{end}} + + + {{.MainTeamGoal}}:{{.GuestTeamGoal}} + + + {{preResultStr .PreResult .AlFlag}} + + + {{if eq .AlFlag "C4"}} + {{.Desc}} + {{else}} + {{.HitCount}} {{end}} - {{else}} - - 暂时没有符合模型的比赛推荐,感谢关注~~~ - - {{end}} + + +{{end}} +{{end}} +{{else}} + + 暂时没有符合模型的比赛推荐,感谢关注~~~ + +{{end}} 声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担. diff --git a/foot-api/module/analy/pojo/AnalyResult.go b/foot-api/module/analy/pojo/AnalyResult.go index 255638fcd8cb7fd0ebfef92ab05295180b5571f6..6bade5ad40a4f7b62ccf744673cd252ec0357f09 100644 --- a/foot-api/module/analy/pojo/AnalyResult.go +++ b/foot-api/module/analy/pojo/AnalyResult.go @@ -35,6 +35,8 @@ type AnalyResult struct { //是否己经作废,因后续结果不符合要求 TOVoid bool `xorm:"bool notnull comment('是否己经作废') index"` TOVoidDesc string `xorm:" comment('作废备注') index"` + //用于增加备注 + Desc string `xorm:" comment('备注信息') index"` pojo.BasePojo `xorm:"extends"` } diff --git a/foot-api/module/match/pojo/BFJin.go b/foot-api/module/match/pojo/BFJin.go index ad9acce53dc70d2be2e7b1a292c8640664d31ec8..efa214515dc96fca0b724b30185f2387824a1ed9 100644 --- a/foot-api/module/match/pojo/BFJin.go +++ b/foot-api/module/match/pojo/BFJin.go @@ -9,7 +9,7 @@ import ( */ type BFJin struct { //比赛ID - ScheduleID int64 `json:"ScheduleID" xorm:"comment('比赛ID') index"` + ScheduleID int64 `json:"ScheduleID" xorm:"comment('比赛ID') unique(ScheduleID) index"` //联赛ID SclassID int64 `json:"SclassID" xorm:"comment('联赛ID') index"` //联赛名称 diff --git a/foot-core/launch/FC200AnalyApplication.go b/foot-core/launch/FC200AnalyApplication.go index 36c259f772e293d3a8aeb8b828b112d3741979ac..4ed2192adda5e768428294f6531c6fd094af5aa8 100644 --- a/foot-core/launch/FC200AnalyApplication.go +++ b/foot-core/launch/FC200AnalyApplication.go @@ -46,7 +46,7 @@ func Analy(all bool) { base.Log.Info("---------------A3模型--------------") base.Log.Info("---------------------------------------------------------------") a3 := new(service.A3Service) - a3.MaxLetBall = 10 + a3.MaxLetBall = 5 a3.Analy(all) base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------C1模型--------------") @@ -61,6 +61,12 @@ func Analy(all bool) { c2.MaxLetBall = maxLetBall c2.Analy(all) base.Log.Info("---------------------------------------------------------------") + base.Log.Info("---------------C4模型--------------") + base.Log.Info("---------------------------------------------------------------") + c4 := new(service.C4Service) + c4.MaxLetBall = 10 + c4.Analy(all) + base.Log.Info("---------------------------------------------------------------") base.Log.Info("---------------处理结果--------------") base.Log.Info("---------------------------------------------------------------") analyService := new(service.AnalyService) diff --git a/foot-core/module/analy/service/AnalyService.go b/foot-core/module/analy/service/AnalyService.go index d2d42948eb74d9c55c1c5841c767d0cebe5244ba..8d3b28c80122e010e78f324001ec23676e9d08ba 100644 --- a/foot-core/module/analy/service/AnalyService.go +++ b/foot-core/module/analy/service/AnalyService.go @@ -57,7 +57,7 @@ func (this *AnalyService) FindAll() []*entity5.AnalyResult { } func (this *AnalyService) AnalyTest(thiz AnalyInterface) { - var currentPage, pageSize int64 = 1, 30000 + var currentPage, pageSize int64 = 1, 10000 var page *pojo.Page page = new(pojo.Page) page.PageSize = pageSize diff --git a/foot-core/module/analy/service/C4Service.go b/foot-core/module/analy/service/C4Service.go new file mode 100644 index 0000000000000000000000000000000000000000..33df39d8d30dec62df5f20065bf9aff00d5284c1 --- /dev/null +++ b/foot-core/module/analy/service/C4Service.go @@ -0,0 +1,194 @@ +package service + +import ( + "fmt" + "math" + "strings" + "tesou.io/platform/foot-parent/foot-api/common/base" + pojo2 "tesou.io/platform/foot-parent/foot-api/common/base/pojo" + entity5 "tesou.io/platform/foot-parent/foot-api/module/analy/pojo" + "tesou.io/platform/foot-parent/foot-api/module/match/pojo" + entity3 "tesou.io/platform/foot-parent/foot-api/module/odds/pojo" + "tesou.io/platform/foot-parent/foot-core/module/analy/constants" + "tesou.io/platform/foot-parent/foot-core/module/match/service" + "time" +) + +type C4Service struct { + AnalyService + service.BFScoreService + service.BFBattleService + service.BFFutureEventService + service.BFJinService + + //最大让球数据 + MaxLetBall float64 +} + +func (this *C4Service) ModelName() string { + return "C4" +} + +func (this *C4Service) AnalyTest() { + this.AnalyService.AnalyTest(this) +} + +func (this *C4Service) Analy(analyAll bool) { + this.AnalyService.Analy(analyAll, this) +} + +func (this *C4Service) Analy_Near() { + this.AnalyService.Analy_Near(this) +} + +/** + -1 参数错误 + -2 不符合让球数 + -3 计算分析错误 + 0 新增的分析结果 + 1 需要更新结果 + */ +func (this *C4Service) analyStub(v *pojo.MatchLast) (int, *entity5.AnalyResult) { + temp_data := this.Find(v.Id, this.ModelName()) + matchId := v.Id + //声明使用变量 + var a18Bet *entity3.AsiaHis + //亚赔 + aList := this.AsiaHisService.FindByMatchIdCompId(matchId, constants.C1_REFER_ASIA) + if len(aList) < 1 { + return -1, temp_data + } + a18Bet = aList[0] + temp_data.LetBall = a18Bet.ELetBall + if math.Abs(a18Bet.ELetBall) > this.MaxLetBall { + //temp_data.Result ="" + return -2, temp_data + } + + //限制初盘,即时盘让球在0.25以内 + if math.Abs(a18Bet.SLetBall-a18Bet.ELetBall) > 0.25 { + temp_data.TOVoid = true + temp_data.TOVoidDesc = "界限" + return -2, temp_data + } + + //得出结果 + preResult := -1 + + matchDateStr := v.MatchDate.Format("2006-01-02 15:04:05") + var currentPage, pageSize int64 = 1, 10 + var page *pojo2.Page + page = new(pojo2.Page) + page.PageSize = pageSize + page.CurPage = currentPage + mainJinList := make([]*pojo.BFJin, 0) + err1 := this.BFJinService.PageSql("SELECT j.* FROM foot.t_b_f_jin j WHERE j.SclassID = "+v.LeagueId+" AND (j.HomeTeam = '"+v.MainTeamId+"' OR j.GuestTeam = '"+v.MainTeamId+"') AND STR_TO_DATE(j.MatchTimeStr, '%Y%m%d%H%i%s') < '"+matchDateStr+"' ORDER BY j.MatchTimeStr DESC ", page, &mainJinList) + if nil != err1 { + base.Log.Error(err1) + return -2, temp_data + } + + guestJinList := make([]*pojo.BFJin, 0) + err2 := this.BFJinService.PageSql("SELECT j.* FROM foot.t_b_f_jin j WHERE j.SclassID = "+v.LeagueId+" AND (j.HomeTeam = '"+v.GuestTeamId+"' OR j.GuestTeam = '"+v.GuestTeamId+"') AND STR_TO_DATE(j.MatchTimeStr, '%Y%m%d%H%i%s') < '"+matchDateStr+"' ORDER BY j.MatchTimeStr DESC ", page, &guestJinList) + if nil != err2 { + base.Log.Error(err2) + return -2, temp_data + } + + if len(mainJinList) < 10 || len(guestJinList) < 10 { + return -2, temp_data + } + + mainGoal, guestGoal := 0, 0 + mainScore, guestScore := 0, 0 + for _, temp := range mainJinList { + if strings.EqualFold(temp.HomeTeam, v.MainTeamId) { + mainGoal += temp.HomeScore + if temp.HomeScore > temp.GuestScore { + mainScore += 3 + } + if temp.HomeScore == temp.GuestScore { + mainScore += 1 + } + } + if strings.EqualFold(temp.GuestTeam, v.MainTeamId) { + mainGoal += temp.GuestScore + if temp.GuestScore > temp.HomeScore { + mainScore += 3 + } + if temp.GuestScore == temp.HomeScore { + mainScore += 1 + } + } + } + + for _, temp := range guestJinList { + if strings.EqualFold(temp.HomeTeam, v.GuestTeamId) { + guestGoal += temp.HomeScore + if temp.HomeScore > temp.GuestScore { + guestScore += 3 + } + if temp.HomeScore == temp.GuestScore { + guestScore += 1 + } + } + if strings.EqualFold(temp.GuestTeam, v.GuestTeamId) { + guestGoal += temp.GuestScore + if temp.GuestScore > temp.HomeScore { + guestScore += 3 + } + if temp.GuestScore == temp.HomeScore { + guestScore += 1 + } + } + } + + diffGoal := float64(mainGoal-guestGoal) / 10 + diffScore := float64(mainScore-guestScore) / 10 + eLetBall := a18Bet.ELetBall + //if eLetBall > 0 { + // if diffGoal > 0 && diffScore > 0 && (math.Abs(diffScore-eLetBall) < 0.25 && math.Abs(diffGoal-eLetBall) < 0.25) { + // preResult = 3 + // } + // + //} else if eLetBall == 0 { + // + //} else { + // //<0 + // if diffGoal < 0 && diffScore < 0 && (math.Abs(diffScore-eLetBall) < 0.25 && math.Abs(diffGoal-eLetBall) < 0.25) { + // preResult = 0 + // } + //} + // + //if preResult < 0 { + // return -3, temp_data + //} + base.Log.Info("对阵:", v.MainTeamId+":"+v.GuestTeamId, ",初盘让球:", a18Bet.SLetBall, ",即时盘让球:", eLetBall, ",球差:", diffGoal, ",分差:", diffScore, " ,比分:", v.MainTeamGoals, ":", v.GuestTeamGoals, " ,半场比分:", v.MainTeamHalfGoals, ":", v.GuestTeamHalfGoals) + + var data *entity5.AnalyResult + if len(temp_data.Id) > 0 { + temp_data.PreResult = preResult + temp_data.HitCount = temp_data.HitCount + 1 + temp_data.LetBall = a18Bet.ELetBall + temp_data.Desc = fmt.Sprintf("分差:%v ,球差:%v", diffScore, diffGoal) + data = temp_data + //比赛结果 + //data.Result = this.IsRight(v, data) + return 1, data + } else { + data = new(entity5.AnalyResult) + data.MatchId = v.Id + data.MatchDate = v.MatchDate + data.SLetBall = a18Bet.SLetBall + data.LetBall = a18Bet.ELetBall + data.Desc = fmt.Sprintf("分差:%v ,球差:%v", diffScore, diffGoal) + data.AlFlag = this.ModelName() + format := time.Now().Format("0102150405") + data.AlSeq = format + data.PreResult = preResult + data.HitCount = 3 + //比赛结果 + //data.Result = this.IsRight(v, data) + return 0, data + } +} diff --git a/foot-core/module/wechat/service/SuggestTodayService.go b/foot-core/module/wechat/service/SuggestTodayService.go index df19275c2af0a510348cb9b60a1a40bb904b3676..93f5552129b15c4be6872408924c4c131fbc3842 100644 --- a/foot-core/module/wechat/service/SuggestTodayService.go +++ b/foot-core/module/wechat/service/SuggestTodayService.go @@ -619,11 +619,11 @@ func (this *SuggestTodayService) ModifyTodayTbs(wcClient *core.Client) { h12, _ = time.ParseDuration("100h") endDate := now.Add(h12) param.EndDateStr = endDate.Format("2006-01-02 15:04:05") - param.AlFlags = []string{"E1", "E2", "Q1"} + param.AlFlags = []string{"E1", "E2", "C4","Q1"} tempList := this.SuggestService.QueryTbs(param) //更新推送 first := material.Article{} - first.Title = fmt.Sprintf("待选场次-E1,E2,Q1") + first.Title = fmt.Sprintf("待选场次-E1,E2,C4,Q1") first.Digest = fmt.Sprintf("%d场赛事", len(tempList)) first.ThumbMediaId = today_tbs_thumbMediaId first.ContentSourceURL = contentSourceURL diff --git a/foot-spider/launch/FS101PortalApplication.go b/foot-spider/launch/FS101PortalApplication.go index 62de43f2a95da5981a3817b57a32a331336b9f69..da55ce0ab171549712765de18a8c8f2c0f1e96c9 100644 --- a/foot-spider/launch/FS101PortalApplication.go +++ b/foot-spider/launch/FS101PortalApplication.go @@ -77,7 +77,7 @@ func Spider_History() { for _, v := range seasons { mysql.ShowSQL(true) Spider_match_his(v) - go Spider_euroLast_his(v) + //go Spider_euroLast_his(v) go Spider_asiaLastNew_his(v) go Spider_baseFace_his(v) //欧赔历史变盘euro track win007己无法获取到 diff --git a/foot-spider/module/win007/Constant.go b/foot-spider/module/win007/Constant.go index 7cf896e75993b58bfd925efd57ae4a95315941b9..0301f966cd4163c6599cc83ff84d6ee77fe01d98 100644 --- a/foot-spider/module/win007/Constant.go +++ b/foot-spider/module/win007/Constant.go @@ -1,30 +1,36 @@ package win007 -const MODULE_FLAG = "win007" - -const WIN007_BASE_URL = "http://m.win007.com/" - -/** - * 比赛分析页面数据 - */ -const WIN007_BASE_FACE_URL_PATTERN = "http://m.win007.com/analy/Analysis/${matchId}.htm" - -/** - * 欧赔, scheid为比赛Id , cId为公司Id - */ -const WIN007_EUROODD_URL_PATTERN = "http://m.win007.com/Compensate/${matchId}.htm" -const WIN007_EUROODD_BET_URL_PATTERN = "http://m.win007.com/1x2Detail.aspx?scheid=${scheid}&cId=${cId}" - -/** - * 亚赔, scheid为比赛Id , cId为公司Id - */ -const WIN007_ASIAODD_URL_PATTERN = "http://m.win007.com/asian/${matchId}.htm" -const WIN007_ASIAODD_NEW_URL_PATTERN = "http://m.win007.com/HandicapDataInterface.ashx?scheid=${matchId}&type=1&oddskind=0&flesh=${flesh}" - -/** -资料库里的比赛赛程前缀 -示例:http://m.win007.com/info/Fixture/2019-2020/34_0_0.htm - */ -const WIN007_MATCH_HIS_PATTERN = "http://m.win007.com/info/Fixture/${season}/${leagueId}_${subId}_${round}.htm" - - +const ( + MODULE_FLAG = "win007" + + WIN007_BASE_URL = "http://m.win007.com/" + + /** + * 比赛分析页面数据 + */ + WIN007_BASE_FACE_URL_PATTERN = "http://m.win007.com/analy/Analysis/${matchId}.htm" + + /** + * 欧赔, scheid为比赛Id , cId为公司Id + */ + WIN007_EUROODD_URL_PATTERN = "http://m.win007.com/Compensate/${matchId}.htm" + WIN007_EUROODD_BET_URL_PATTERN = "http://m.win007.com/1x2Detail.aspx?scheid=${scheid}&cId=${cId}" + + /** + * 亚赔, scheid为比赛Id , cId为公司Id + */ + WIN007_ASIAODD_URL_PATTERN = "http://m.win007.com/asian/${matchId}.htm" + WIN007_ASIAODD_NEW_URL_PATTERN = "http://m.win007.com/HandicapDataInterface.ashx?scheid=${matchId}&type=1&oddskind=0&flesh=${flesh}" + + /** + 资料库里的比赛赛程前缀 + 示例:http://m.win007.com/info/Fixture/2019-2020/34_0_0.htm + */ + WIN007_MATCH_HIS_PATTERN = "http://m.win007.com/info/Fixture/${season}/${leagueId}_${subId}_${round}.htm" +) + +const ( + SLEEP_RAND_S = 10 + SLEEP_RAND_E = 100 + +) diff --git a/foot-spider/module/win007/proc/AsiaLastNewProcesser.go b/foot-spider/module/win007/proc/AsiaLastNewProcesser.go index 5c923743af3a6784abb8bd1e7138db7d530ad5e1..4b62546420abb3e01ef25dc4bc04edd2933848ad 100644 --- a/foot-spider/module/win007/proc/AsiaLastNewProcesser.go +++ b/foot-spider/module/win007/proc/AsiaLastNewProcesser.go @@ -54,7 +54,7 @@ func (this *AsiaLastNewProcesser) Startup() { //先将前面的spider启动 newSpider.SetDownloader(down.NewMAsiaLastApiDownloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(10).Run() processer = GetAsiaLastNewProcesser() @@ -77,7 +77,7 @@ func (this *AsiaLastNewProcesser) Startup() { newSpider.SetDownloader(down.NewMAsiaLastApiDownloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/BaseFaceProcesser.go b/foot-spider/module/win007/proc/BaseFaceProcesser.go index 54b72cfdc18ef1f92859fd62020ca8600d25fa16..e8f0e502846353808c6634735cd8f7c143f36504 100644 --- a/foot-spider/module/win007/proc/BaseFaceProcesser.go +++ b/foot-spider/module/win007/proc/BaseFaceProcesser.go @@ -58,7 +58,7 @@ func (this *BaseFaceProcesser) Startup() { //先将前面的spider启动 newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(10).Run() processer = GetBaseFaceProcesser() @@ -80,7 +80,7 @@ func (this *BaseFaceProcesser) Startup() { newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/EuroLastProcesser.go b/foot-spider/module/win007/proc/EuroLastProcesser.go index b30f9da702a5bed8742f06764e78b68c8ecda366..52da57f0181c193a1cea52883eb1d1e5d30df09d 100644 --- a/foot-spider/module/win007/proc/EuroLastProcesser.go +++ b/foot-spider/module/win007/proc/EuroLastProcesser.go @@ -60,7 +60,7 @@ func (this *EuroLastProcesser) Startup() { //先将前面的spider启动 newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(10).Run() processer = GetEuroLastProcesser() @@ -82,7 +82,7 @@ func (this *EuroLastProcesser) Startup() { newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/EuroTrackProcesser.go b/foot-spider/module/win007/proc/EuroTrackProcesser.go index d752b021e308f278bcc6f1be869e590107374ce2..847ca6e3476754412a0cce469419d5b3089261a8 100644 --- a/foot-spider/module/win007/proc/EuroTrackProcesser.go +++ b/foot-spider/module/win007/proc/EuroTrackProcesser.go @@ -59,7 +59,7 @@ func (this *EuroTrackProcesser) Startup() { //先将前面的spider启动 newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(10).Run() processer = GetEuroTrackProcesser() @@ -83,7 +83,7 @@ func (this *EuroTrackProcesser) Startup() { newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/LeagueProcesser.go b/foot-spider/module/win007/proc/LeagueProcesser.go index 4a726e01e2c19ad0bb36399849cbc9885b0aebeb..cc479346bb568999184f8f147bd24c1feefc6af2 100644 --- a/foot-spider/module/win007/proc/LeagueProcesser.go +++ b/foot-spider/module/win007/proc/LeagueProcesser.go @@ -70,14 +70,14 @@ func (this *LeagueProcesser) Startup() { if i%10 == 0 { //10个联赛一个spider,总数1000多个联赛,最多100spider newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } }) newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/LeagueSeasonProcesser.go b/foot-spider/module/win007/proc/LeagueSeasonProcesser.go index 01f1a7b12c551a7d3899547bfa3b5e56dd4d04c8..1b93d13701a1cadca0d6e17d0f38f4a386642a92 100644 --- a/foot-spider/module/win007/proc/LeagueSeasonProcesser.go +++ b/foot-spider/module/win007/proc/LeagueSeasonProcesser.go @@ -83,14 +83,14 @@ func (this *LeagueSeasonProcesser) Startup() { if i % 10 == 0 {//10个联赛一个spider,总数1000多个联赛,最多100spider newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(10).Run() } } newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/MatchHisProcesser.go b/foot-spider/module/win007/proc/MatchHisProcesser.go index 5838a2639c264c717081dd3071fda80f07014cf3..50a1c65327868a41594d420e4f056a802be9260f 100644 --- a/foot-spider/module/win007/proc/MatchHisProcesser.go +++ b/foot-spider/module/win007/proc/MatchHisProcesser.go @@ -70,7 +70,7 @@ func (this *MatchHisProcesser) Startup() { //先将前面的spider启动 newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(10).Run() processer = GetMatchHisProcesser() @@ -94,7 +94,7 @@ func (this *MatchHisProcesser) Startup() { newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() } diff --git a/foot-spider/module/win007/proc/MatchLastProcesser.go b/foot-spider/module/win007/proc/MatchLastProcesser.go index c4a773b7ffae880690549667da03ab3a550746c7..f4b75afe86b579a8938937ca7eed753324dd5802 100644 --- a/foot-spider/module/win007/proc/MatchLastProcesser.go +++ b/foot-spider/module/win007/proc/MatchLastProcesser.go @@ -57,7 +57,7 @@ func (this *MatchLastProcesser) Startup() { newSpider = newSpider.AddUrl(this.MatchlastUrl, "text") newSpider.SetDownloader(down.NewMWin007Downloader()) newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole()) - newSpider.SetSleepTime("rand", 1, 300) + newSpider.SetSleepTime("rand", win007.SLEEP_RAND_S, win007.SLEEP_RAND_E) newSpider.SetThreadnum(1).Run() }