获取当日热门搜索词

This commit is contained in:
2024-12-16 11:42:56 +08:00
parent 5d22686cf8
commit eb2e0e5d2a

View File

@@ -37,8 +37,8 @@ export function get_views(name, ids = []) {
export function get_search(n = 10) { export function get_search(n = 10) {
const ex = new Map() const ex = new Map()
const all = { 文章, 作品, 游戏, 截图, 收藏, 综合 } const all = { 文章, 作品, 游戏, 截图, 收藏, 综合 }
for (const item of all) { for (const key in all) {
item.搜索词.forEach((value, key) => { all[key].搜索词.forEach((value, key) => {
ex.set(key, (ex.get(key) || 0) + value) ex.set(key, (ex.get(key) || 0) + value)
}) })
} }
@@ -155,7 +155,7 @@ export function main() {
文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1) 文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1)
文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1) 文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1)
文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1) 文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1)
文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1) 文章.浏览数..set(id, (文章.浏览数..get(id) || 0) + 1)
} }
} }