def search_spammer(): # here to detect if the new review is a spam #return request.form["title"] min_score = 1 dup_no = dup.dup(min_score, request.args.get["text"]) # userid = "ALYU98KL3VUGF"/A1GLC0S9H532IU min_post = 1 early_constraint = 3600*24*180 # (sec*min)*hours*days*months detection_dict = dev.spammer_detect(request.args.get["userid"], min_post, early_constraint) #return str(devnrep_dict["time_diff"]) detection_dict["dup_no"] = dup_no detection_dict["metric"] = dev.metrics(detection_dict) #print detection_dict return render_template("result.html", result = detection_dict)
def reducer(self, key, values): result = dev.spammer_detect(key, 3, 3600*24*180) result["_id"] = key users.insert(result) yield key, result