def vis(): query = count = request.args.get("query", None) if query: count = int(request.args.get("count", "10")) search_engine = GoogleSearch(__google_config) results = search_engine.search(query, count) clusterizer = DCSClusterizer(__dcs_config) clusters = clusterizer.clusterize(results) str_clusters = json.dumps(clusters) json.dump(clusters, open("data.json", "wb")) params = {"mode": "vis", "data": str_clusters} return render_template("visual.html", params=params) return redirect(url_for('index'))
def vis(): query = count = request.args.get("query", None) if query: count = int(request.args.get("count", "10")) search_engine = GoogleSearch(__google_config) results = search_engine.search(query, count) clusterizer = DCSClusterizer(__dcs_config) clusters = clusterizer.clusterize(results) str_clusters = json.dumps(clusters) json.dump(clusters, open("data.json","wb")) params = { "mode" : "vis", "data" : str_clusters } return render_template("visual.html", params = params) return redirect(url_for('index'))
def run_test(): search_engine = GoogleSearch(google_config) results = search_engine.search("who was Thomas Baker?", 100) clusterizer = DCSClusterizer(dcs_config) clusters = clusterizer.clusterize(results)