For statistical purposes, I like to ensure that I don't count myself in my web page statistics. sisynala and KDE's wonderful Konqueror browser makes this easy for me. Here's how.

Create the ~/.kde/share/services/useragentstrings directory, and create a file foo.desktop, with the following contents:

[Desktop Entry]
Encoding=UTF-8
Name=UADescription (nbm)
Type=Service
ServiceTypes=UserAgentStrings
X-KDE-UA-TAG=MISC
X-KDE-UA-FULL=Mozilla/5.0 (compatible; Konqueror/3.1; Linux; CUSTOMSTRING)
X-KDE-UA-NAME=NBM
X-KDE-UA-VERSION=1.0

sisynala has a configuration function named EXCLUDEDFUNC. Simply create a new EXCLUDEDFUNC in localconfig.py, looking like this:

def EXCLUDEDBYFUNC(line):
    if line['agent'] == 'Mozilla/5.0 (compatible; Konqueror/3.1; Linux; CUSTOMSTRING)':
        return 1
    return 0

I actually do this another way myself - I have an array PLACES_I_VISIT and MY_AGENTS, and also occasionally use a dynamic IP for dial-up. Here's my EXCLUDEDFUNC:

def EXCLUDEDBYFUNC(line):
    if line['ip'] in PLACES_I_VISIT and line['agent'] in MY_AGENTS:
        return 1
    if line['ip'].startswith("155.239.") and line['agent'] in MY_AGENTS:
        return 1
    return 0
blog comments powered by Disqus