#!/usr/local/bin/python # Change to #!H:\Python24\python.exe under Windows ###!H:\Python24\python.exe ### Change to #!/usr/local/bin/python under Linux # # By Gilbert Le Blanc # http://www.python-cgi-programming.com/ # webmaster@python-cgi-programming.com # # Released under GNU Public License # # Copyright (C) # This program is free software; you can redistribute it and/or modify it under the terms of the # GNU General Public License as published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # http://www.opensource.org/licenses/gpl-license.html # This General Public License does not permit incorporating your program into proprietary programs. # # August 18, 2005 - Version 1.00 # import os import string import sys from ReferrerFunctions import extract_data, show_data # Inline code to process template #print "Content-Type: text/html" print "Content-Type: text/javascript" print sys.stderr = sys.stdout # Get the key values from the query string parameters = repr(os.environ.get("QUERY_STRING")) parameters = parameters.strip("'") #print parameters expires = extract_data (parameters, 'exp=', '&', 0) limit = extract_data (parameters, 'lim=', '&', 0) minimum = extract_data (parameters, 'min=', '&', 0) URL_out = extract_data (parameters, 'out=', '&', 0) #print URL_out, minimum, expires, limit referrers = show_data (URL_out, minimum, expires, limit) print referrers sys.exit(0)