Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Stroop jpstroop

  • Princeton University Library
  • Princeton, NJ
View GitHub Profile
@jpstroop
jpstroop / bots.py
Created Dec 4, 2012 — forked from edsu/bots.py
see what your bot traffic is like
View bots.py
#!/usr/bin/env python
"""
Hack to look for user agent strings in typical Apache style log and
count up the number of requests by bots vs non-bots. The list of bot
user agents comes from http://www.user-agents.org/ but has had some
agents added to it, since the user-agents.org list is pretty out of date, e.g.
no Bing?!
"""