コード例 #1
0
def get_btn():
    btn_address = request.form['btn_address']

    if not btn_address:
        flash('Please enter a valid bitcoin address')
        return redirect(url_for('home'))

    btc = BTCNetwork()
    data = btc.data_parse(origin=btn_address)

    return jsonify(nodes=data[0], links=data[1])
コード例 #2
0
def get_btn():
    btn_address = request.form['btn_address']

    if not btn_address:
        flash('Please enter a valid bitcoin address')
        return redirect(url_for('home'))

    btc = BTCNetwork()
    data = btc.data_parse(origin=btn_address)

    return jsonify(nodes=data[0], links=data[1])
コード例 #3
0
def get_cluster():
    origin = request.form['origin_addr']

    if not origin:
        flash('Please enter a valid bitcoin address')
        return redirect(url_for('home'))

    btc = BTCNetwork()
    nodes, links = btc.data_parse(origin=origin)

    clustered_nodes, clustered_links, number_of_clusters = btc.data_clust(
        origin, nodes, links)
    return jsonify(nodes=clustered_nodes,
                   links=clustered_links,
                   number_of_clusters=number_of_clusters)
コード例 #4
0
def get_cluster():
    origin = request.form['origin_addr']

    if not origin:
        flash('Please enter a valid bitcoin address')
        return redirect(url_for('home'))

    btc = BTCNetwork()
    nodes, links = btc.data_parse(origin=origin)

    clustered_nodes, clustered_links, number_of_clusters = btc.data_clust(origin, nodes, links)
    return jsonify(nodes=clustered_nodes, links=clustered_links, number_of_clusters=number_of_clusters)


#if __name__=="__main__":
#    app.run()
    #btc = BTCNetwork()
    #origin = '17z35xHz19KcdnxDGH9awSsqxSYSLeu35T'
    #nodes, links = btc.data_parse(origin=origin)
    #clustered_nodes, clustered_links, number_of_clusters = btc.data_clust(origin, nodes, links)
コード例 #5
0
    btc = BTCNetwork()
    data = btc.data_parse(origin=btn_address)

    return jsonify(nodes=data[0], links=data[1])


@app.route("/get_cluster", methods=['POST'])
def get_cluster():
    origin = request.form['origin_addr']

    if not origin:
        flash('Please enter a valid bitcoin address')
        return redirect(url_for('home'))

    btc = BTCNetwork()
    nodes, links = btc.data_parse(origin=origin)

    clustered_nodes, clustered_links, number_of_clusters = btc.data_clust(
        origin, nodes, links)
    return jsonify(nodes=clustered_nodes,
                   links=clustered_links,
                   number_of_clusters=number_of_clusters)


if __name__ == "__main__":
    app.run()
    btc = BTCNetwork()
    origin = '17z35xHz19KcdnxDGH9awSsqxSYSLeu35T'
    nodes, links = btc.data_parse(origin=origin)
    clustered_nodes, clustered_links, number_of_clusters = btc.data_clust(
        origin, nodes, links)