提交 30905740 编写于 作者: M monomania

1.增加公众号文章前后引导及文中广告

上级 7a31b6a5
## 项目地址
* [https://gitee.com/aoe5188/foot](https://gitee.com/aoe5188/foot)
## 很遗憾,项目己部分闭源,且不会再更新维护
## 项目介绍
>> 1. 究极足球爱好者,平时也会去体彩店支持一下国足,或是自己喜欢的球队.
>> 2. 入了门道,就想结合一下所学所专,尝试着分析预测一下足球比赛.最近命中率感觉还可以阿.
......
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"/>
</div>
<h1><strong>概况</strong></h1>
<ul style="font-size: 12px;font-weight: bold">
<li>日期:{{.BeginDateStr}} 至 {{.EndDateStr}}</li>
......@@ -55,4 +58,7 @@
{{end}}
{{end}}
</table>
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
\ No newline at end of file
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_png/BePaFicK2B5R6lNrnAdOpR63megZibx7Gnqj9UlhbGMnKbDYmfkFvIhRsz5LEK27Fukf0sE8NzOlNI2nALx25icQQ/0?wx_fmt=png">
</div>
\ No newline at end of file
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"/>
</div>
<h1 style="color: red;font-weight: bold;font-size: 12px"><strong>注意</strong></h1>
<ul style="color: red;font-weight: bold;font-size: 12px">
<li><strong>1.比赛为程序自动处理,自动更新同步,目前更新周期为30~60分钟一次.</strong></li>
......@@ -17,11 +20,11 @@
<div style="float: left;width: 40%"><strong>赛事列表</strong></div>
<div style="float: right;width: 40%;font-weight: bold;font-size: 12px">
模型:
<span style="color: orange">A1</span>
<span style="color: orangered">A2</span>
<span style="color: blue">E1</span>
<span style="color: darkblue">E2</span>
<span style="color: olivedrab">Q1</span>
<span style="color: orange">A1</span>
<span style="color: orangered">A2</span>
<span style="color: blue">E1</span>
<span style="color: darkblue">E2</span>
<span style="color: olivedrab">Q1</span>
</div>
</h1>
<table style="font-size: 12px;font-weight: bold">
......@@ -33,34 +36,39 @@
<td>推荐(模型)</td>
</tr>
{{if .DataList}}
{{with .DataList}}
{{range .}}
<tr>
<td>{{.MatchDateStr}}</td>
<td>{{.LeagueName}}</td>
<td>{{.MainTeam}}({{.LetBall}}){{.GuestTeam}}</td>
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
style="background-color: orange"
{{end}}
>
{{preResultStr .PreResult .AlFlag}}<span style="color: {{color .AlFlag}}">({{.AlFlag}})</span>
</td>
{{with .DataList}}
{{range .}}
<tr>
<td>{{.MatchDateStr}}</td>
<td>{{.LeagueName}}</td>
<td>{{.MainTeam}}({{.LetBall}}){{.GuestTeam}}</td>
<td>
{{.MainTeamGoal}}:{{.GuestTeamGoal}}
</td>
<td
{{if eq .Result "正确"}}
style="background-color: red"
{{else if eq .Result "错误"}}
style="background-color: gray"
{{else if eq .Result "走盘"}}
style="background-color: greenyellow"
{{else}}
style="background-color: orange"
{{end}}
>
{{preResultStr .PreResult .AlFlag}}<span style="color: {{color .AlFlag}}">({{.AlFlag}})</span>
</td>
</tr>
{{end}}
{{end}}
</tr>
{{end}}
{{end}}
{{else}}
<tr><td colspan="5" style="color: red;font-weight: bold;font-size: 12px">暂时没有符合模型的比赛推荐,感谢关注~~~</td></tr>
<tr>
<td colspan="5" style="color: red;font-weight: bold;font-size: 12px">暂时没有符合模型的比赛推荐,感谢关注~~~</td>
</tr>
{{end}}
</table>
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
\ No newline at end of file
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_png/BePaFicK2B5R6lNrnAdOpR63megZibx7Gnqj9UlhbGMnKbDYmfkFvIhRsz5LEK27Fukf0sE8NzOlNI2nALx25icQQ/0?wx_fmt=png">
</div>
\ No newline at end of file
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"/>
</div>
<h1 style="color: red;font-weight: bold;font-size: 12px"><strong>注意</strong></h1>
<ul style="color: red;font-weight: bold;font-size: 12px">
<li><strong>1.比赛为程序自动处理,自动更新同步,目前更新周期为30~60分钟一次.</strong></li>
......@@ -38,4 +41,7 @@
<br/>
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
\ No newline at end of file
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_png/BePaFicK2B5R6lNrnAdOpR63megZibx7Gnqj9UlhbGMnKbDYmfkFvIhRsz5LEK27Fukf0sE8NzOlNI2nALx25icQQ/0?wx_fmt=png">
</div>
\ No newline at end of file
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"/>
</div>
<h1 style="color: red;font-weight: bold;font-size: 12px"><strong>注意</strong></h1>
<ul style="color: red;font-weight: bold;font-size: 12px">
<li><strong>1.比赛为程序自动处理,自动更新同步,目前更新周期为30~60分钟一次.</strong></li>
......@@ -56,4 +59,7 @@
<tr><td colspan="6" style="color: red;font-weight: bold;font-size: 12px">暂时没有符合模型的比赛推荐,感谢关注~~~</td></tr>
{{end}}
</table>
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
\ No newline at end of file
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_png/BePaFicK2B5R6lNrnAdOpR63megZibx7Gnqj9UlhbGMnKbDYmfkFvIhRsz5LEK27Fukf0sE8NzOlNI2nALx25icQQ/0?wx_fmt=png">
</div>
\ No newline at end of file
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"/>
</div>
<h1><strong>概况</strong></h1>
<ul style="font-size: 12px;font-weight: bold">
<li>日期:{{.BeginDateStr}} 至 {{.EndDateStr}}</li>
......@@ -55,4 +58,7 @@
{{end}}
{{end}}
</table>
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
\ No newline at end of file
<span style="color: red;font-weight: bold;font-size: 12px">声明:彩市有风险,购彩需谨慎.AI球探只提供预测参考,不构成购彩建议,据AI球探购彩者风险自担.</span>
<div>
<img src="http://mmbiz.qpic.cn/sz_mmbiz_png/BePaFicK2B5R6lNrnAdOpR63megZibx7Gnqj9UlhbGMnKbDYmfkFvIhRsz5LEK27Fukf0sE8NzOlNI2nALx25icQQ/0?wx_fmt=png">
</div>
\ No newline at end of file
......@@ -23,4 +23,5 @@
"fileName is: assets/16.jpg,mediaId is : chP-LBQxy9SVbAFjwZ4QEgIU_dXnFnXHvYzocwCpkM4 ,url is : http://mmbiz.qpic.cn/sz_mmbiz_jpg/BePaFicK2B5QZuw0bf1HsiarnqQXzuWxE92y6PhGre05TwpWYaSj0cmyAxHVotQibURMHqwYqvR7c05ercY11K6FQ/0?wx_fmt=jpeg",
"fileName is: assets/17.jpg,mediaId is : chP-LBQxy9SVbAFjwZ4QEpOPdIm42ibP0pbNFt6VtAI ,url is : http://mmbiz.qpic.cn/sz_mmbiz_jpg/BePaFicK2B5QZuw0bf1HsiarnqQXzuWxE9ogvYdcdKGWkQbBWxxgHulRzunHdG6oJ1E82xcqqDk9wicjTYljZUtxA/0?wx_fmt=jpeg",
]
"fileName is: assets/wechat/img/follow_head.gif,mediaId is : chP-LBQxy9SVbAFjwZ4QEmE0SaglrrzcsqZ2Kuswecs ,url is : http://mmbiz.qpic.cn/sz_mmbiz_gif/BePaFicK2B5R6lNrnAdOpR63megZibx7GnwXTAl2yZTEibKIbCFrs0QpsmOWG0CrxWEicHldX2ibqva6Ise5G5vILCQ/0?wx_fmt=gif"
"fileName is: assets/wechat/img/follow_bottom.png,mediaId is : chP-LBQxy9SVbAFjwZ4QEqVYyz0pfodyN1M82aUJiV4 ,url is : http://mmbiz.qpic.cn/sz_mmbiz_png/BePaFicK2B5R6lNrnAdOpR63megZibx7Gnqj9UlhbGMnKbDYmfkFvIhRsz5LEK27Fukf0sE8NzOlNI2nALx25icQQ/0?wx_fmt=png"
......@@ -11,30 +11,9 @@ type BaseFace struct {
//比赛id
MatchId string `xorm:"comment('比赛ID') unique(MatchId)"`
/**
数据时间
*/
DataDate string `xorm:" comment('数据时间') index"`
/**
* 联赛Id
*/
LeagueId string `xorm:" comment('联赛Id') index"`
/**
* 主队id,目前为主队名称
*/
MainTeamId string `xorm:"unique(MatchDate_MainTeamId_GuestTeamId)"`
/**
* 主队进球数
*/
MainTeamGoals int `xorm:" comment('主队进球数') index"`
/**
* 客队id,目前为客队名称
*/
GuestTeamId string `xorm:"unique(MatchDate_MainTeamId_GuestTeamId)"`
/**
* 客队进球数
*/
GuestTeamGoals int `xorm:" comment('客队进球数') index"`
pojo.BasePojo `xorm:"extends"`
}
......
......@@ -16,6 +16,20 @@ type MaterialController struct {
service.MaterialService
}
func (this *MaterialController) Image() {
fileName := "assets/wechat/img/follow_bottom.png"
mediaId, url, err := material.UploadImage(wcClient, fileName)
if err != nil {
base.Log.Error(err)
return
}
data := fmt.Sprintf("fileName is: %v,mediaId is : %v ,url is : %v", fileName, mediaId, url)
base.Log.Info(data)
this.Data["json"] = data
this.ServeJSON()
}
func (this *MaterialController) Images() {
infos, err := ioutil.ReadDir("assets/wechat/img")
......
......@@ -5,7 +5,7 @@ const MODULE_FLAG = "win007"
/**
* 比赛分析页面数据
*/
const WIN007_MATCH_ANALY_URL_PATTERN = "http://m.win007.com/analy/Analysis/${matchId}.htm"
const WIN007_BASE_FACE_URL_PATTERN = "http://m.win007.com/analy/Analysis/${matchId}.htm"
/**
* 欧赔, scheid为比赛Id , cId为公司Id
......
package proc
import (
"encoding/json"
"github.com/PuerkitoBio/goquery"
"github.com/hu17889/go_spider/core/common/page"
"github.com/hu17889/go_spider/core/pipeline"
"github.com/hu17889/go_spider/core/spider"
"tesou.io/platform/foot-parent/foot-api/common/base"
"tesou.io/platform/foot-parent/foot-spider/module/win007/down"
"strings"
"tesou.io/platform/foot-parent/foot-api/module/match/pojo"
"tesou.io/platform/foot-parent/foot-spider/module/win007"
"tesou.io/platform/foot-parent/foot-spider/module/win007/vo"
)
type BaseFaceProcesser struct {
//博彩公司对应的win007id
MatchLastList []*pojo.MatchLast
Win007idMatchidMap map[string]string
}
func GetBaseFaceProcesser() *BaseFaceProcesser {
return &BaseFaceProcesser{}
}
func (this *BaseFaceProcesser) Startup() {
this.Win007idMatchidMap = map[string]string{}
newSpider := spider.NewSpider(this, "BaseFaceProcesser")
for _, v := range this.MatchLastList {
i := v.Ext[win007.MODULE_FLAG]
bytes, _ := json.Marshal(i)
matchLastExt := new(pojo.MatchExt)
json.Unmarshal(bytes, matchLastExt)
win007_id := matchLastExt.Sid
this.Win007idMatchidMap[win007_id] = v.Id
url := strings.Replace(win007.WIN007_BASE_FACE_URL_PATTERN, "${matchId}", win007_id, 1)
newSpider = newSpider.AddUrl(url, "html")
}
newSpider.SetDownloader(down.NewMWin007Downloader())
newSpider = newSpider.AddPipeline(pipeline.NewPipelineConsole())
newSpider.SetThreadnum(1).Run()
}
func (this *BaseFaceProcesser) Process(p *page.Page) {
request := p.GetRequest()
if !p.IsSucc() {
base.Log.Info("URL:,", request.Url, p.Errormsg())
return
}
var hdata_str string
p.GetHtmlParser().Find("script").Each(func(i int, selection *goquery.Selection) {
text := selection.Text()
if hdata_str == "" && strings.Contains(text, "var hData") {
hdata_str = text
} else {
return
}
})
if hdata_str == "" {
return
}
// 获取script脚本中的,博彩公司信息
hdata_str = strings.Replace(hdata_str, ";", "", 1)
hdata_str = strings.Replace(hdata_str, "var hData = ", "", 1)
base.Log.Info(hdata_str)
this.hdata_process(request.Url, hdata_str)
}
func (this *BaseFaceProcesser) hdata_process(url string, hdata_str string) {
var hdata_list = make([]*vo.HData, 0)
json.Unmarshal(([]byte)(hdata_str), &hdata_list)
//var regex_temp = regexp.MustCompile(`(\d+).htm`)
//win007Id := strings.Split(regex_temp.FindString(url), ".")[0]
//matchId := this.Win007Id_matchId_map[win007Id]
//入库中
}
func (this *BaseFaceProcesser) Finish() {
base.Log.Info("比赛分析抓取解析完成 \r\n")
}
......@@ -40,7 +40,7 @@ func (this *MatchAnalyProcesser) Startup() {
this.Win007idMatchidMap[win007_id] = v.Id
url := strings.Replace(win007.WIN007_MATCH_ANALY_URL_PATTERN, "${matchId}", win007_id, 1)
url := strings.Replace(win007.WIN007_BASE_FACE_URL_PATTERN, "${matchId}", win007_id, 1)
newSpider = newSpider.AddUrl(url, "html")
}
newSpider.SetDownloader(down.NewMWin007Downloader())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册