|
@@ -499,9 +499,10 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
}))
|
|
}))
|
|
//推送列表页下载数据量
|
|
//推送列表页下载数据量
|
|
s.L.SetGlobal("sendListNum", s.L.NewFunction(func(S *lua.LState) int {
|
|
s.L.SetGlobal("sendListNum", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
|
+ index := S.ToInt(-2)
|
|
table := S.ToTable(-1)
|
|
table := S.ToTable(-1)
|
|
list := util.TableToMap(table)
|
|
list := util.TableToMap(table)
|
|
- if len(list) > 0 {
|
|
|
|
|
|
+ if index <= 1 && len(list) > 0 {
|
|
UpdateHeart(*site, *channel, code, *user, "findlist") //记录列表页实际采集数据量心跳
|
|
UpdateHeart(*site, *channel, code, *user, "findlist") //记录列表页实际采集数据量心跳
|
|
}
|
|
}
|
|
return 1
|
|
return 1
|
|
@@ -918,8 +919,10 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
s.L.SetGlobal("stringFind", s.L.NewFunction(func(S *lua.LState) int {
|
|
s.L.SetGlobal("stringFind", s.L.NewFunction(func(S *lua.LState) int {
|
|
regstr := S.ToString(-1)
|
|
regstr := S.ToString(-1)
|
|
text := S.ToString(-2)
|
|
text := S.ToString(-2)
|
|
- reg := regexp.MustCompile(regstr)
|
|
|
|
- result := reg.FindString(text)
|
|
|
|
|
|
+ textReg := regexp.MustCompile(regstr)
|
|
|
|
+ spaceReg := regexp.MustCompile("[\\s\u3000\u2003\u00a0]+")
|
|
|
|
+ text = spaceReg.ReplaceAllString(text, "")
|
|
|
|
+ result := textReg.FindString(text)
|
|
isMatch := false
|
|
isMatch := false
|
|
if result != "" {
|
|
if result != "" {
|
|
isMatch = true
|
|
isMatch = true
|