Off The Clock Pages | If you use Google Sites (like I do) you know there is no good way to allow guests to leave comments or discuss your pages. The more popular choice it to use a combination of Google Documents spreadsheet and a form. This leaves a clunky ugly spreadsheet on the bottom of your page. Not the best choice. I am not saying my solution is the best either, but it suits my needs and has a cleaner look. Plus it is free. If you have access to a server you can run CGI on you can use this set up. I have a Linux web server running in my home office on normal cable modem. Not the ideal choice for hosting a web site due to speed and port availability (i.e. port 80 is blocked.) However with the use of a dynamic DNS service it is a satisfactory solution for running the comments CGI script. Google Sites will allow you to embed an external CGI page into your Sites page by using IFRAME. <iframe name="foo" src="yourserver/cgibin/bar.cgi?read=filename></iframe> Filename is where you choose what to call the text file that will hold the comments for that page. It will look like all other Google Sites Widgets in the editor but will look clean when viewed. I have attached a modified version of the C code I wrote. The key features are: One compiled program handles all pages.
Automatically creates text files for the comments. Converts HTTP/URL escape characters to ascii. Small foot print on the server. No HTML files to maintain. Basics:
CGI program takes in the Query String and determines whether and where to write the comments to. If we are going to write a comment, remove the escape codes from the URL string. Write them to the appropriate file. Display the comment form. Display the comments. It is really that easy. I used more lines of code than needed doing silly pointer things, but it is pretty basic. If you want to use it, add your own level of error checking and security as you chose. Thanks Kyle for some bug finding! CODE:
|