maxiaoshan 4 years ago
parent
commit
2f28903e8e
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/spiderutil/publishtime.go

+ 5 - 3
src/spiderutil/publishtime.go

@@ -48,9 +48,11 @@ var (
 func GetPublishtime(textArr []string) string {
 	defer util.Catch()
 	for _, text := range textArr {
-		t, b := GetPublishtimeByText(text)
-		if b && t < time.Now().Unix() {
-			return util.FormatDateByInt64(&t, util.Date_Full_Layout)
+		if text != "" {
+			t, b := GetPublishtimeByText(text)
+			if b && t < time.Now().Unix() {
+				return util.FormatDateByInt64(&t, util.Date_Full_Layout)
+			}
 		}
 	}
 	return "0"