import string import cgi import whrandom true = 1 false = 0 path = '/home/macd/fb/webpage/search/' hints = [ """
If you have a suggestion, criticism, or comment for the Xarph Search Engine, send some email to Fred! He's at fmb1@cornell.edu.
""", """The Xarph Search Engine 2.1 is still available! So is Version 2.0 and even Version 1.0! None of those are nearly as cool as this one, though.
""", """"Smart Search" automatically puts an AND in between all the words you type in. This works on most of the web search engines that Xarph supports, too!
""", """If you aren't sure if a word will be on the webpage you want, tell the Xarph Search Engine that it shouldn't exclude all pages that have it. Put a '/' or a '|' character in front of the word.
For example:
Xarph /Searchwill search for pages that definitely have "Xarph" in them, and will show you the pages that have "Search" in them first. """, """
If you want AltaVista or many of the other search engines to exclude pages that have a certain word, put a '-' character in front of the word to exclude.
For example:
Xarph -Searchwill search for pages that have "Xarph" but not "Search" in them. """, """
If you want to search for two words that are right next to each other, put them in double quotes. For example,
"Xarph Search"searches for "Xarph" and "Search" that are right next to each other.
This is supported by most of the search engines.
""", """If you don't care about the capitalization of a word, put it in lower case. If you want only a particular capitalization, capitalize at least one letter of the word. Unfortunately, there is no way to force something to be lower case, but you could do this:
xarph -Xarph -XARPHto eliminate the most common ways of capitalizing a word. """, """
The Xarph Search Engine does more than just search engines! Try selecting "Webster's Dictionary" from the popdown menu to use an english dictionary.
""", """CNF Equipment Scheduling can be done from here, too! It's the selection just below the default in the popdown menu, so it's even easy to get to. Try typing in "help" to get some advice on how to use it. It's far easier than the CNF's scheduler!
""", """Want the weather? Try the "Weather Underground" in the popdown menu. Type in the name of the city you want and the state. For example,
Ithaca, NYgets you the local weather here at Cornell. However, in the case of Ithaca, you can just type "Ithaca" without the state. Xarph will fill in the state for you! ("Gunks" works, too!) """, """
Want to search just one website, but their search engine sucks? Don't worry! Xarph can help you out! Just type in your search normally, and add "host:www.sitename.com". For example,
Xarph host:mems.ee.cornell.eduwill search for "Xarph" only on this computer. (This is particularly useful with microsoft's site. Their search engine is really pathetic!) """, """ Want to find a picture of something? Try adding
image:*.jpgto your search. It doesn't work well, but it works better than a lot of techniques. """, """
Not sure of the tense of a verb or the plurality of a noun? Add an asterix to the end of what you do know! AltaVista will accept things like "dog*", but, of course, it will find "dogcatcher" and "dogerel" as well as "dogs" and "dog". So be careful with this one!
""", """Wondering why AltaVista is the default search engine? After all, it's not even close to the most popular one! I've found, however, that it consistently outperformed the top five search engines combined! That is, it finds way more sites that match your query than anything else.
""", """Looking for an old Usenet news posting? Try DejaNews. (It's in the popdown menu.) If you're looking for something very recent, look in the normal one. If you want something that could be old, look in "DejaNews (Old News)". Their server can't handle updating the recent news very well, so the up to date database is kept fairly small.
""", """Wondering what "Smart Search" does? Well, if you turn it off, it won't be smart anymore! Xarph will send the search string on to the server unprocessed.
""", """Got any suggestions for the Xarph Search Engine 3.0? One idea is to have configurable search engines. You'd enter the URL, the default settings, and how you want Xarph to modify the search string. Then you'd have your own settings for the engine! You'd have to type in your user name, but that could be kept as a cookie or set by changing the URL for the Xarph Search Engine a bit (or both).
If you think this is a good idea, let me know! If you wouldn't even consider using it, let me know, too! User feedback is the only way this gets any better.
""", """I am considering monitoring the usage of the Xarph Search Engine. I would not record the search string that anyone uses, but I might record the IP address of the computer being used, the search engine that's being used, and perhaps the use of special characters in the search string (such as '+', '-', '/', or '|').
This will not be implemented until 1999, so please complain to me before then if you have any complaints.
""" ] # # GetFile # def GetFile( strFileName ): file = open( strFileName, 'r' ) strFile = '' strLine = file.readline() while strLine != '': strFile = strFile + strLine strLine = file.readline() file.close() return strFile # # PrintHeader # # This prints the necessary header info for a html file. # def PrintHeader(): print 'Content-type: text/html\n\n' # # CreatePage # def CreatePage( form ): if( not form.has_key( 'printall' ) ): str = GetFile( path + 'MainPage.html' ) index = int( whrandom.random() * len( hints ) ) dict = { 'hint' : hints[ index ], 'number' : '#' + `index + 1` + ':' } return str % dict else: strExtra = """