Ejemplo n.º 1
0
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'))
Ejemplo n.º 2
0
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'))
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)