This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use client userAagent's lowercase to match these: | |
Wechat: /micromessenger/, | |
QQBrowser: /qqbrowser/, | |
UC: /ubrowser|ucbrowser|ucweb/, | |
Shoujibaidu: /baiduboxapp|baiduhd|bidubrowser|baidubrowser/, | |
SamsungBrowser: /samsungbrowser/, | |
MiuiBrowser: /miuibrowser/, | |
Sogou : /sogoumobilebrowser|sogousearch/, | |
Explorer2345 : /2345explorer|2345chrome|mb2345browser/, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o nounset | |
set -o errexit | |
IFS=$'\n' | |
dt=$(date -d'yesterday' '+%Y%m%d') #每天读取前一天的日志 | |
logfile="/var/log/nginx/access.log-${dt}.gz" #nginx access.log日志 | |
#读取日志并将User Agent信息中包含爬虫标识的过滤出来进行解析操作 | |
zcat ${logfile} | awk -F'"' 'tolower($6)~/bot|spider|yahoo! slurp/ && $2~/GET/ {print $0}' | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var browserName = "Other"; | |
var ua = window.navigator.userAgent; | |
browserRegExp = { | |
Sogou : /SE\s2\.X|SogouMobileBrowser/, | |
Explorer2345 : /2345Explorer|2345chrome|Mb2345Browser/, | |
Liebao : /LBBROWSER/, | |
Wechat : /MicroMessenger/, | |
QQBrowser : /QQBrowser/, | |
Baidu : /BIDUBrowser|baidubrowser|BaiduHD/, |