cookiecutter.py listing


This is the current under devlopment version of cookiecutter.py- this is a ssi include of the actual almost working version in our server NOW. You can examint it's operational output at COOKIETEST.SHTML

You can download the tarball also. cookiecutter.1.0.0.tar.gz This includes a readme file for the program.


#!/usr/local/bin/python
#
# cookiecutter.py V:1.0.0 COPYRIGHT 2002 by Kirk D Bailey
# Released under the GNU GPL. Use this at will as a fortune cookie machine.
# It is invoked as 
# assuming the source file is in the directory with the script. 
# The  path to the source file is also required. Paths are RELATIVE
# TO THE WEB DIRECTORY, which the cgi will treat as the home reference-
# in effect, that web directory is the scenter of the world all other
# things relate to. The invokine line would look like:
# 
# import random, string, sys # # comment the next line out if you use the # tag- which is insecure! # print "Content-Type: text/html \n\n" # try: myfile=string.strip(sys.argv[1]) # first arguement is the filename except Exception, e: # if it cannot do this, print "ERROR:"+str(e) # display the error returned sys.exit() # then abort. # # # ok, now we read the cookie jar try: f1=open(myfile,'r') # open the file, cookiejar=f1.readlines() # read it in to a list, f1.close() # close the file, print random.choice(cookiejar) # print ONE SELECTED ITEM from it, sys.exit() # Then exit the program. except Exception, e: # if you cannot do this, print str(e) # print the error returned, then quit.




ODD#kdb/cookielisting.shtml