diff --git a/lab-6/cgi-bin/serve_fluckable_cat.py b/lab-6/cgi-bin/serve_fluckable_cat.py deleted file mode 100755 index 68f8dd4ad598f4807c67554a02f73f31f240acc6..0000000000000000000000000000000000000000 --- a/lab-6/cgi-bin/serve_fluckable_cat.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 - -from utils import db_connect -from bson.objectid import ObjectId -from datetime import datetime - -import cgi -import cgitb -cgitb.enable() - -# connect to database -db = db_connect() - -# output some header html -print("Content-Type: text/html\n") -print(""" - -
- -You are viewing a random image of a cat.
-This poor cat has been flucked {} times already.
- """.format( img_src, img_alt, str(num_flucks) )) -else: - print("Oops. Something went wrong!
") - -# output a form with skip/fluck buttons -print("""""".format( img_id )) - -# check if either button clicked and insert a fluck in the database -if 'btn_fluck' in form: - result = db.flucks.insert( { - "image_id":ObjectId(form['img_id'].value), - "is_flucked":1, - "timestamp":datetime.now().timestamp() - } ) -elif 'btn_skip' in form: - result = db.flucks.insert( { - "image_id":ObjectId(form['img_id'].value), - "is_flucked":0, - "timestamp":datetime.now().timestamp() - } ) - -# output some footer html -print("")