处理搜索日志
This commit is contained in:
17
main.js
17
main.js
@@ -193,15 +193,14 @@ export function main() {
|
|||||||
const url = decodeURI(item.request.uri)
|
const url = decodeURI(item.request.uri)
|
||||||
const regex = /text:"([^"]*)"/g
|
const regex = /text:"([^"]*)"/g
|
||||||
const match = regex.exec(url) || []
|
const match = regex.exec(url) || []
|
||||||
match.map(item => item[1]).forEach(item => {
|
if (match) {
|
||||||
截图.搜索词.日.set(item, (截图.搜索词.日.get(item) || 0) + 1)
|
let key = match[1]
|
||||||
截图.搜索词.周.set(item, (截图.搜索词.周.get(item) || 0) + 1)
|
截图.搜索词.日.set(key, (截图.搜索词.日.get(key) || 0) + 1)
|
||||||
截图.搜索词.月.set(item, (截图.搜索词.月.get(item) || 0) + 1)
|
截图.搜索词.周.set(key, (截图.搜索词.周.get(key) || 0) + 1)
|
||||||
截图.搜索词.年.set(item, (截图.搜索词.年.get(item) || 0) + 1)
|
截图.搜索词.月.set(key, (截图.搜索词.月.get(key) || 0) + 1)
|
||||||
截图.搜索词.总.set(item, (截图.搜索词.总.get(item) || 0) + 1)
|
截图.搜索词.年.set(key, (截图.搜索词.年.get(key) || 0) + 1)
|
||||||
})
|
截图.搜索词.总.set(key, (截图.搜索词.总.get(key) || 0) + 1)
|
||||||
console.log(match)
|
}
|
||||||
console.log(match[1])
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user