公平,限制长度,即限制关键词

This commit is contained in:
suguo.yao 2022-10-18 13:28:20 +08:00
parent deb1460964
commit 2f62b12b73
1 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,15 @@ func siteAccess(uri *string) error {
description, _ = s.Attr("content")
}
})
//保持公平,长度限制
if len(title) > 20 {
title = title[:20]
}
if len(description) > 200 {
description = description[:200]
}
if title != "" {
id := uint32(crc32.ChecksumIEEE([]byte(*uri)))
r := strings.Split(*uri, ".")