Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F12825300
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
765 B
Subscribers
None
View Options
diff --git a/bots/findBots.sh b/bots/findBots.sh
index 81db94a..3e95392 100755
--- a/bots/findBots.sh
+++ b/bots/findBots.sh
@@ -1,32 +1,32 @@
#!/bin/bash
#
# Generates a Go map containing all bots that have accessed Write.as
#
-cat /var/log/$1 | grep -i bot | awk -F\" '{print $4}' | sort | uniq > bots.txt
+cat /var/log/$1 | grep -i 'bot\|crawler\|voltron' | awk -F\" '{print $4}' | sort | uniq > bots.txt
rm bots.go
cat > bots.go << EOM
package bots
var bots = map[string]bool {
EOM
while read b; do
if [ -n "$b" ]; then
echo " \"$b\": true," >> bots.go
fi
done <bots.txt
cat >> bots.go << EOM
};
func IsBot(ua string) bool {
if _, ok := bots[ua]; ok {
return true
}
return false
}
EOM
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Dec 26, 5:05 AM (1 d, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3561162
Attached To
rWC Write.as Web Core
Event Timeline
Log In to Comment