获取当日热门搜索词
This commit is contained in:
4
main.js
4
main.js
@@ -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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user