posted May 8, 2017, 7:19 AM by Samuel Konstantinovich   [ updated May 8, 2017, 8:31 AM ]
Goal: Final Update on text analysis

You need to make your website accessible using:
That should work as homer/lisa inside the StuyCS network or clyde if you are outside. (DOE wifi is considered outside)

Make your website randomly choose between 3 different books.
names= ["WotW","Frank","holmes"]

Just pick one randomly and use that string + ".txt" for the file name.

Also it is very easy to convert name to book title:
title = {"WotW":"War of the Worlds", "holmes":"Sherlock Holmes","Frank":"Frankenstein"}

This will give you the actual title of the book:


1. First 4 lines:
print "Content-type: text/html\n"
import cgitb

2. Executeable.
In the lab: 
  Right click the file and click properties -> permissions
  Check the "executeable" checkbox to allow it to be run.
At home: 
  In filezilla/winscp, right click the REMOTE file (right side of screen)
  Check off the "X" checkboxes to make it executeable

3. Windows Line endings. 
At home:
   When uploading using winscp select "text" as your transfer mode (instead of default)
At school:
   Open the file using gedit. 
   On the Gedit menu bar (top of window, or top of screen) Click file->save as        
   Make sure the line endings is set to "unix/linux", NOT "windows"