Author: kiyoto <[email protected]> Date: Tue, 26 Oct 2010 09:56:53 -0700 Subject: Added Python HOWTO Commit: c49b0a61cf83a78a3b413a4a1c70c4de5a250aa0
--- visitor/HOWTO | 37 +++++++++++++++++++++++++++++++++++++ visitor/visitor.py | 2 +- 2 files changed, 38 insertions(+), 1 deletions(-) diff --git a/visitor/HOWTO b/visitor/HOWTO index 6d89797..d9957ff 100644 --- a/visitor/HOWTO +++ b/visitor/HOWTO @@ -100,3 +100,40 @@ R Quick Start - Find the generated graph in /home/you/visitor/visitors.png . + +--------------------------------------------------------------------------- + +Python Quick Start + +- This is a port of the original implementation in Java to Python. In order +to run this, you need a decently up-to-date version of Python interpreter +(I have tried it with Python 2.4 and 2.7), which you can check if you have +by typeing `which python` in the terminal. + +- Just as the Java version, you need to download the exit list from + https://metrics.torproject.org/data.html#exitlist + +- Once you have uncompressed the folder, you can run the script by typing + + python visitor.py <access log> <exit list> [<output file>] + + where <access log> is the name of the Apache access log you wish to + analyze, <exit list> is the uncompressed exit list folder, and <output + file> is the optional argument specifying the name of the output file. + If <output file> is missing, the program outputs the result to stdout. + The program also outputs some warning/messages to stderr. + + Unlike the Java version, currently <access log> needs to be *uncompressed* + (The Java version allows you to pass in a gzipped access log). + + example + ------- + Suppose you have an Apache log named "access_log" and an exit list called + "exit_list", and wish to publish the statistics to a file named "stats.csv". + Then, type + + python visitor.py access_log exit_list stats.csv + + or + + python visitor.py access_log exit_list > stats.csv diff --git a/visitor/visitor.py b/visitor/visitor.py index 6950cfe..e779f9a 100644 --- a/visitor/visitor.py +++ b/visitor/visitor.py @@ -1,4 +1,4 @@ -# Copyright 2010 The Tor Project +# Copyright 2010 Kiyoto Tamura <[email protected]> # See LICENSE for licensing information # # A Python port of Karsten Loesing's VisiTor. -- 1.7.1
