|
@@ -18,9 +18,6 @@ import (
|
|
"strconv"
|
|
"strconv"
|
|
"sync"
|
|
"sync"
|
|
|
|
|
|
- //mgu "qfw/util/mongodbutil"
|
|
|
|
- //"qfw/util/redis"
|
|
|
|
-
|
|
|
|
es "qfw/util/elastic"
|
|
es "qfw/util/elastic"
|
|
"regexp"
|
|
"regexp"
|
|
util "spiderutil"
|
|
util "spiderutil"
|
|
@@ -342,15 +339,8 @@ func (s *Spider) DownListPageItem() (errs interface{}) {
|
|
atomic.AddInt32(&s.TotalDowncount, 1)
|
|
atomic.AddInt32(&s.TotalDowncount, 1)
|
|
href := fmt.Sprint(tmp["href"])
|
|
href := fmt.Sprint(tmp["href"])
|
|
if len(href) > 5 { //有效数据
|
|
if len(href) > 5 { //有效数据
|
|
- db := HexToBigIntMod(href) //根据href的哈希值选择Redis的db
|
|
|
|
hashHref := HexText(href)
|
|
hashHref := HexText(href)
|
|
- //增量(redis默认db0)
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- //全量(判断是否已存在防止覆盖id)
|
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_fulljudgement", db, hashHref)
|
|
|
|
- if !isExist {
|
|
|
|
- util.PutRedis("title_repeat_fulljudgement", db, hashHref, "", -1)
|
|
|
|
- }
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1) //全量redis
|
|
list = append(list, tmp)
|
|
list = append(list, tmp)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -491,24 +481,20 @@ func (s *Spider) HistoricalMendDownloadDetailItem(p interface{}) {
|
|
if len(href) <= 5 { //无效数据
|
|
if len(href) <= 5 { //无效数据
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- db := HexToBigIntMod(href)
|
|
|
|
hashHref := HexText(href)
|
|
hashHref := HexText(href)
|
|
id := ""
|
|
id := ""
|
|
- SaveListPageData(paramdata, &id, false) //存储采集记录
|
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_fulljudgement", db, hashHref) //取全量redis
|
|
|
|
- //log.Println("full href:", href, " isExist:", isExist)
|
|
|
|
|
|
+ SaveListPageData(paramdata, &id, false) //存储采集记录
|
|
|
|
+ isExist := util.RedisClusterExists(hashHref) //取全量redis
|
|
logger.Debug("full href:", href, " isExist:", isExist)
|
|
logger.Debug("full href:", href, " isExist:", isExist)
|
|
if !s.IsMustDownload && isExist { //非强制下载redis中存在,结束
|
|
if !s.IsMustDownload && isExist { //非强制下载redis中存在,结束
|
|
- //qu.Debug("非强制下载redis中存在,结束")
|
|
|
|
//更新spider_listdata中数据下载成功标记
|
|
//更新spider_listdata中数据下载成功标记
|
|
if id != "" {
|
|
if id != "" {
|
|
- //Mgo.Update("spider_listdata", map[string]interface{}{"href": href}, map[string]interface{}{"$set": map[string]interface{}{"state": 1, "byid": id}}, false, true)
|
|
|
|
Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": map[string]interface{}{"state": 1, "exist": true, "updatetime": time.Now().Unix()}})
|
|
Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": map[string]interface{}{"state": 1, "exist": true, "updatetime": time.Now().Unix()}})
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
//qu.Debug("----------------下载、解析、入库--------------------")
|
|
//qu.Debug("----------------下载、解析、入库--------------------")
|
|
- //下载、解析、入库
|
|
|
|
|
|
+ //下载详情页
|
|
data, err = s.DownloadDetailPage(paramdata, data)
|
|
data, err = s.DownloadDetailPage(paramdata, data)
|
|
if err != nil || data == nil { //下载失败,结束
|
|
if err != nil || data == nil { //下载失败,结束
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -526,12 +512,7 @@ func (s *Spider) HistoricalMendDownloadDetailItem(p interface{}) {
|
|
//详情页过滤数据
|
|
//详情页过滤数据
|
|
set := map[string]interface{}{"state": 1, "updatetime": time.Now().Unix()}
|
|
set := map[string]interface{}{"state": 1, "updatetime": time.Now().Unix()}
|
|
if data["delete"] != nil {
|
|
if data["delete"] != nil {
|
|
- //增量
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- //全量
|
|
|
|
- db := HexToBigIntMod(href)
|
|
|
|
- hashHref := HexText(href)
|
|
|
|
- util.PutRedis("title_repeat_fulljudgement", db, hashHref, "", -1)
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1) //过滤掉的数据存值全量redis
|
|
//更新mgo 要删除的数据更新spider_highlistdata state=1不再下载,更新redis
|
|
//更新mgo 要删除的数据更新spider_highlistdata state=1不再下载,更新redis
|
|
set["delete"] = true
|
|
set["delete"] = true
|
|
Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": set})
|
|
Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": set})
|
|
@@ -539,7 +520,6 @@ func (s *Spider) HistoricalMendDownloadDetailItem(p interface{}) {
|
|
}
|
|
}
|
|
//更新spider_listdata中数据下载成功标记
|
|
//更新spider_listdata中数据下载成功标记
|
|
if id != "" {
|
|
if id != "" {
|
|
- //Mgo.Update("spider_listdata", map[string]interface{}{"href": href}, map[string]interface{}{"$set": map[string]interface{}{"state": 1, "byid": id}}, false, true)
|
|
|
|
Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": set})
|
|
Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": set})
|
|
}
|
|
}
|
|
flag := true
|
|
flag := true
|
|
@@ -547,18 +527,16 @@ func (s *Spider) HistoricalMendDownloadDetailItem(p interface{}) {
|
|
if s.IsMustDownload { //强制下载
|
|
if s.IsMustDownload { //强制下载
|
|
if isExist && t1 < time.Now().AddDate(0, 0, -5).Unix() {
|
|
if isExist && t1 < time.Now().AddDate(0, 0, -5).Unix() {
|
|
//qu.Debug("强制下载 redis存在")
|
|
//qu.Debug("强制下载 redis存在")
|
|
- data["dataging"] = 1
|
|
|
|
|
|
+ data["dataging"] = 1 //此处dataging=1对应保存服务中取redis中href对应的id值,进行更新(现redis中已无id值,所以无效)
|
|
flag = false
|
|
flag = false
|
|
} else {
|
|
} else {
|
|
//qu.Debug("强制下载 redis不存在")
|
|
//qu.Debug("强制下载 redis不存在")
|
|
data["dataging"] = 0
|
|
data["dataging"] = 0
|
|
- //WithinThreeDays(&data) //根据发布时间打标记
|
|
|
|
}
|
|
}
|
|
} else { //非强制下载
|
|
} else { //非强制下载
|
|
if !isExist {
|
|
if !isExist {
|
|
//qu.Debug("非强制下载 redis不存在")
|
|
//qu.Debug("非强制下载 redis不存在")
|
|
data["dataging"] = 0
|
|
data["dataging"] = 0
|
|
- //WithinThreeDays(&data) //根据发布时间打标记
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if t1 > time.Now().Unix() { //防止发布时间超前
|
|
if t1 > time.Now().Unix() { //防止发布时间超前
|
|
@@ -592,33 +570,17 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
*num++ //视为已采集
|
|
*num++ //视为已采集
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- /*
|
|
|
|
- //查询增量redis查看信息是否已经下载
|
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
|
- if isExist { //更新redis生命周期
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, href, 3600*24*30)
|
|
|
|
- *num++ //已采集
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- log.Println("href had++:", isExist, href)
|
|
|
|
- */
|
|
|
|
|
|
+ hashHref := HexText(href)
|
|
id := "" //记录spider_listdata中保存的数据id,便于下载成功后更新状态
|
|
id := "" //记录spider_listdata中保存的数据id,便于下载成功后更新状态
|
|
if util.Config.Modal == 1 { //除7000、7500、7700节点外所有节点只采集列表页信息
|
|
if util.Config.Modal == 1 { //除7000、7500、7700节点外所有节点只采集列表页信息
|
|
- isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
|
- if isExist { //更新redis生命周期
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- *num++ //已采集
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- SaveHighListPageData(paramdata, s.SCode, href, num)
|
|
|
|
|
|
+ SaveHighListPageData(paramdata, s.SCode, hashHref, num)
|
|
return
|
|
return
|
|
} else {
|
|
} else {
|
|
if !s.Stop {
|
|
if !s.Stop {
|
|
UpdateHeart(s.Name, s.Channel, s.Code, s.MUserName, "detail") //记录modal=0老模式采集三级页心跳
|
|
UpdateHeart(s.Name, s.Channel, s.Code, s.MUserName, "detail") //记录modal=0老模式采集三级页心跳
|
|
}
|
|
}
|
|
- isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
|
- if isExist { //更新redis生命周期
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
|
|
+ isExist := util.RedisClusterExists(hashHref) //全量信息中已采集
|
|
|
|
+ if isExist {
|
|
*num++ //已采集
|
|
*num++ //已采集
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -634,7 +596,7 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
}
|
|
}
|
|
SaveListPageData(paramdata, &id, isEsRepeat) //保存7000、7410、7500、7700节点列表页采集的信息
|
|
SaveListPageData(paramdata, &id, isEsRepeat) //保存7000、7410、7500、7700节点列表页采集的信息
|
|
if isEsRepeat { //类竞品数据title判重数据加入redis
|
|
if isEsRepeat { //类竞品数据title判重数据加入redis
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1) //全量存值
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -653,16 +615,7 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
}
|
|
}
|
|
return
|
|
return
|
|
} else if tmphref := qu.ObjToString(data["href"]); tmphref != href { //三级页href替换导致前后href不同
|
|
} else if tmphref := qu.ObjToString(data["href"]); tmphref != href { //三级页href替换导致前后href不同
|
|
- log.Println("beforeHref:", href, "afterHref:", tmphref)
|
|
|
|
- //增量
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- //全量
|
|
|
|
- db := HexToBigIntMod(href)
|
|
|
|
- hashHref := HexText(href)
|
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_fulljudgement", db, hashHref)
|
|
|
|
- if !isExist {
|
|
|
|
- util.PutRedis("title_repeat_fulljudgement", db, hashHref, "", -1)
|
|
|
|
- }
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1) //全量redis中存值列表页href
|
|
}
|
|
}
|
|
//详情页下载数据成功心跳
|
|
//详情页下载数据成功心跳
|
|
if !s.Stop {
|
|
if !s.Stop {
|
|
@@ -671,12 +624,7 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
set := map[string]interface{}{"state": 1, "updatetime": time.Now().Unix(), "byid": id}
|
|
set := map[string]interface{}{"state": 1, "updatetime": time.Now().Unix(), "byid": id}
|
|
//详情页过滤数据
|
|
//详情页过滤数据
|
|
if data["delete"] != nil {
|
|
if data["delete"] != nil {
|
|
- //增量
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- //全量
|
|
|
|
- db := HexToBigIntMod(href)
|
|
|
|
- hashHref := HexText(href)
|
|
|
|
- util.PutRedis("title_repeat_fulljudgement", db, hashHref, "", -1)
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1) //过滤掉的数据存值全量redis
|
|
//更新mgo 要删除的数据更新spider_highlistdata state=1不再下载,更新redis
|
|
//更新mgo 要删除的数据更新spider_highlistdata state=1不再下载,更新redis
|
|
set["delete"] = true
|
|
set["delete"] = true
|
|
Mgo.Update("spider_listdata", map[string]interface{}{"href": href}, map[string]interface{}{"$set": set}, false, true)
|
|
Mgo.Update("spider_listdata", map[string]interface{}{"href": href}, map[string]interface{}{"$set": set}, false, true)
|
|
@@ -685,7 +633,6 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
//更新spider_listdata中数据下载成功标记
|
|
//更新spider_listdata中数据下载成功标记
|
|
if id != "" {
|
|
if id != "" {
|
|
Mgo.Update("spider_listdata", map[string]interface{}{"href": href}, map[string]interface{}{"$set": set}, false, true)
|
|
Mgo.Update("spider_listdata", map[string]interface{}{"href": href}, map[string]interface{}{"$set": set}, false, true)
|
|
- //Mgo.UpdateById("spider_listdata", id, map[string]interface{}{"$set": map[string]interface{}{"state": 1}})
|
|
|
|
}
|
|
}
|
|
|
|
|
|
t1 := util.ParseDate2Int64(qu.ObjToString(data["publishtime"]))
|
|
t1 := util.ParseDate2Int64(qu.ObjToString(data["publishtime"]))
|
|
@@ -700,21 +647,8 @@ func (s *Spider) DownloadDetailItem(p interface{}, num *int) {
|
|
atomic.AddInt32(&s.TodayDowncount, 1)
|
|
atomic.AddInt32(&s.TodayDowncount, 1)
|
|
atomic.AddInt32(&s.TotalDowncount, 1)
|
|
atomic.AddInt32(&s.TotalDowncount, 1)
|
|
data["spidercode"] = s.Code
|
|
data["spidercode"] = s.Code
|
|
- //qu.Debug("-----增量开始保存-----")
|
|
|
|
-
|
|
|
|
- // 临时保存数据
|
|
|
|
- // update := []map[string]interface{}{}
|
|
|
|
- // _id := data["_id"].(string)
|
|
|
|
- // update = append(update, map[string]interface{}{"_id": qu.StringTOBsonId(_id)})
|
|
|
|
- // update = append(update, map[string]interface{}{
|
|
|
|
- // "$set": map[string]interface{}{
|
|
|
|
- // "jsondata": data["jsondata"],
|
|
|
|
- // },
|
|
|
|
- // })
|
|
|
|
- // UpdataMgoCache <- update
|
|
|
|
data["iscompete"] = s.IsCompete //2021-11-01以后新增的爬虫不在展示原文链接(保存服务判断)
|
|
data["iscompete"] = s.IsCompete //2021-11-01以后新增的爬虫不在展示原文链接(保存服务判断)
|
|
Store(s.StoreMode, s.StoreToMsgEvent, s.Collection, s.CoverAttr, data, true)
|
|
Store(s.StoreMode, s.StoreToMsgEvent, s.Collection, s.CoverAttr, data, true)
|
|
- //qu.Debug("-----增量保存结束-----")
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//遍历下载名录
|
|
//遍历下载名录
|
|
@@ -924,10 +858,11 @@ func (s *Spider) DownloadDetail(stype string) {
|
|
_id := tmp["_id"]
|
|
_id := tmp["_id"]
|
|
query := map[string]interface{}{"_id": _id}
|
|
query := map[string]interface{}{"_id": _id}
|
|
href := qu.ObjToString(tmp["href"])
|
|
href := qu.ObjToString(tmp["href"])
|
|
|
|
+ hashHref := HexText(href)
|
|
update := []map[string]interface{}{}
|
|
update := []map[string]interface{}{}
|
|
//由于目前列表页redis判重是href+code可能导致同一条href有多条不同code采集的数据存在
|
|
//由于目前列表页redis判重是href+code可能导致同一条href有多条不同code采集的数据存在
|
|
- //为了避免重复下载,进行增量redis判重
|
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
|
|
|
+ //为了避免重复下载,进行全量redis判重
|
|
|
|
+ isExist := util.RedisClusterExists(hashHref)
|
|
if isExist {
|
|
if isExist {
|
|
set := map[string]interface{}{"$set": map[string]interface{}{"state": 1, "exist": true, "updatetime": time.Now().Unix()}} //已存在state置为1
|
|
set := map[string]interface{}{"$set": map[string]interface{}{"state": 1, "exist": true, "updatetime": time.Now().Unix()}} //已存在state置为1
|
|
update = append(update, query)
|
|
update = append(update, query)
|
|
@@ -944,7 +879,7 @@ func (s *Spider) DownloadDetail(stype string) {
|
|
esQuery := `{"query": {"filtered": {"filter": {"bool": {"must": [{"range": {"comeintime": {"gte": "` + fmt.Sprint(sTime) + `","lte": "` + fmt.Sprint(eTime) + `"}}}]}},"query": {"bool": {"must": [{"multi_match": {"query": "` + title + `","type": "phrase","fields": ["title"]}}]}}}}}`
|
|
esQuery := `{"query": {"filtered": {"filter": {"bool": {"must": [{"range": {"comeintime": {"gte": "` + fmt.Sprint(sTime) + `","lte": "` + fmt.Sprint(eTime) + `"}}}]}},"query": {"bool": {"must": [{"multi_match": {"query": "` + title + `","type": "phrase","fields": ["title"]}}]}}}}}`
|
|
count := Es.Count(EsIndex, EsType, esQuery)
|
|
count := Es.Count(EsIndex, EsType, esQuery)
|
|
if count > 0 { //es中含本title数据,不再采集,更新list表数据状态
|
|
if count > 0 { //es中含本title数据,不再采集,更新list表数据状态
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1)
|
|
set := map[string]interface{}{"$set": map[string]interface{}{"state": 1, "exist": true, "updatetime": time.Now().Unix()}} //已存在state置为1
|
|
set := map[string]interface{}{"$set": map[string]interface{}{"state": 1, "exist": true, "updatetime": time.Now().Unix()}} //已存在state置为1
|
|
update = append(update, query)
|
|
update = append(update, query)
|
|
update = append(update, set)
|
|
update = append(update, set)
|
|
@@ -980,16 +915,7 @@ func (s *Spider) DownloadDetail(stype string) {
|
|
DownloadErrorData(s.Code, tmp)
|
|
DownloadErrorData(s.Code, tmp)
|
|
}*/
|
|
}*/
|
|
} else if tmphref := qu.ObjToString(data["href"]); tmphref != href { //三级页href替换导致前后href不同
|
|
} else if tmphref := qu.ObjToString(data["href"]); tmphref != href { //三级页href替换导致前后href不同
|
|
- log.Println("beforeHref:", href, "afterHref:", tmphref)
|
|
|
|
- //增量
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- //全量
|
|
|
|
- db := HexToBigIntMod(href)
|
|
|
|
- hashHref := HexText(href)
|
|
|
|
- isExist, _ := util.ExistRedis("title_repeat_fulljudgement", db, hashHref)
|
|
|
|
- if !isExist {
|
|
|
|
- util.PutRedis("title_repeat_fulljudgement", db, hashHref, "", -1)
|
|
|
|
- }
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1)
|
|
}
|
|
}
|
|
|
|
|
|
if !success { //下载失败更新次数和状态
|
|
if !success { //下载失败更新次数和状态
|
|
@@ -1005,12 +931,7 @@ func (s *Spider) DownloadDetail(stype string) {
|
|
spLock.Unlock()
|
|
spLock.Unlock()
|
|
return
|
|
return
|
|
} else if data["delete"] != nil { //三级页过滤
|
|
} else if data["delete"] != nil { //三级页过滤
|
|
- //增量
|
|
|
|
- util.PutRedis("title_repeat_judgement", 0, "url_repeat_"+href, "", 3600*24*365)
|
|
|
|
- //全量
|
|
|
|
- db := HexToBigIntMod(href)
|
|
|
|
- hashHref := HexText(href)
|
|
|
|
- util.PutRedis("title_repeat_fulljudgement", db, hashHref, "", -1)
|
|
|
|
|
|
+ util.RedisClusterSet(hashHref, "", -1) //过滤掉的数据存值全量redis
|
|
//更新mgo 要删除的数据更新spider_highlistdata state=1不再下载,更新redis
|
|
//更新mgo 要删除的数据更新spider_highlistdata state=1不再下载,更新redis
|
|
set := map[string]interface{}{"$set": map[string]interface{}{"state": 1, "delete": true, "updatetime": time.Now().Unix()}}
|
|
set := map[string]interface{}{"$set": map[string]interface{}{"state": 1, "delete": true, "updatetime": time.Now().Unix()}}
|
|
update = append(update, query)
|
|
update = append(update, query)
|
|
@@ -1173,36 +1094,3 @@ func HexText(href string) string {
|
|
h.Write([]byte(href))
|
|
h.Write([]byte(href))
|
|
return fmt.Sprintf("%x", h.Sum(nil))
|
|
return fmt.Sprintf("%x", h.Sum(nil))
|
|
}
|
|
}
|
|
-
|
|
|
|
-//func RedisIsExist(href string) bool {
|
|
|
|
-// isExist := false
|
|
|
|
-// if len(href) > 75 { //取href的哈希判断是否存在
|
|
|
|
-// hashHref := GetHas1(href)
|
|
|
|
-// isExist, _ = util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+hashHref)
|
|
|
|
-// }
|
|
|
|
-// if !isExist { //取string href判断是否存在
|
|
|
|
-// isExist, _ = util.ExistRedis("title_repeat_judgement", 0, "url_repeat_"+href)
|
|
|
|
-// }
|
|
|
|
-// return isExist
|
|
|
|
-//}
|
|
|
|
-
|
|
|
|
-//判断发布时间是否在三天内
|
|
|
|
-//func WithinThreeDays(data *map[string]interface{}) {
|
|
|
|
-// withinThreeDays := false
|
|
|
|
-// //根据发布时间打标记
|
|
|
|
-// publishtime := util.ParseDate2Int64(qu.ObjToString((*data)["publishtime"])) //没有发布时间,取当前时间
|
|
|
|
-// //发布时间
|
|
|
|
-// now := time.Now().Unix()
|
|
|
|
-// if now-publishtime > 259200 { //三天前数据
|
|
|
|
-// withinThreeDays = false
|
|
|
|
-// } else {
|
|
|
|
-// withinThreeDays = true
|
|
|
|
-// }
|
|
|
|
-// if withinThreeDays {
|
|
|
|
-// //qu.Debug("发布时间在三天内")
|
|
|
|
-// (*data)["dataging"] = 0
|
|
|
|
-// } else {
|
|
|
|
-// //qu.Debug("发布时间在三天外")
|
|
|
|
-// (*data)["dataging"] = 1
|
|
|
|
-// }
|
|
|
|
-//}
|
|
|