Пример #1
0
def known_load_hosts(page=1):

    hosts = hosts_handler(page=int(page) + 1, which_collection="known-data")

    if request_wants_json():
        return Response(json.dumps(hosts), mimetype="application/json")

    return render_template('hosts.html', hosts=hosts, which_collection="known-data", use_known_data=True)
Пример #2
0
def data(page=1):

    filter_field = request.args.get('filter-field')
    filter_regex = request.args.get('filter-regex')

    hosts = hosts_handler(page=int(page))

    return render_template('data.html', hosts=hosts, which_collection="crawl-data", 
                           filter_field = filter_field, filter_regex = filter_regex, use_cc_data=False)
Пример #3
0
def known_load_hosts(page=1):

    show_all = request.args.get('show-all')

    hosts = hosts_handler(page=int(page) + 1, page_size=StaticSettings().page_size, which_collection="known-data", show_all=show_all)

    if request_wants_json():
        return Response(json.dumps(hosts), mimetype="application/json")

    return render_template('hosts.html', hosts=hosts, which_collection="known-data", use_known_data=True)
Пример #4
0
def load_hosts(page=1):

    filter_field = request.args.get('filter-field')
    filter_regex = request.args.get('filter-regex')

    hosts = hosts_handler(page=int(page) + 1, filter_field = filter_field, filter_regex = filter_regex)

    if request_wants_json():
        return Response(json.dumps(hosts), mimetype="application/json")

    return render_template('hosts.html', hosts=hosts, use_cc_data=False, page = page)
Пример #5
0
def load_hosts(page=1):

    filter_field = request.args.get('filter-field')
    filter_regex = request.args.get('filter-regex')
    show_all = request.args.get('show-all')

    hosts = hosts_handler(page=int(page) + 1, page_size=StaticSettings().page_size, filter_field = filter_field, filter_regex = filter_regex, show_all=show_all)
    for host_dic in hosts:
        host_dic["host_hash"] = str(hashlib.md5(host_dic["host"]).hexdigest())
        if "tags" in host_dic:
            host_dic["tags_joined"] = ",".join(host_dic["tags"])

    if request_wants_json():
        return Response(json.dumps(hosts), mimetype="application/json")

    return render_template('hosts.html', hosts=hosts, use_cc_data=False, page=page)
Пример #6
0
def known_load_hosts(page=1):

    show_all = request.args.get('show-all')

    hosts = hosts_handler(page=int(page) + 1,
                          page_size=StaticSettings().page_size,
                          which_collection="known-data",
                          show_all=show_all)

    if request_wants_json():
        return Response(json.dumps(hosts), mimetype="application/json")

    return render_template('hosts.html',
                           hosts=hosts,
                           which_collection="known-data",
                           use_known_data=True)
Пример #7
0
def load_hosts(page=1):

    filter_field = request.args.get('filter-field')
    filter_regex = request.args.get('filter-regex')
    show_all = request.args.get('show-all')

    hosts = hosts_handler(page=int(page) + 1,
                          page_size=StaticSettings().page_size,
                          filter_field=filter_field,
                          filter_regex=filter_regex,
                          show_all=show_all)
    for host_dic in hosts:
        host_dic["host_hash"] = str(hashlib.md5(host_dic["host"]).hexdigest())
        if "tags" in host_dic:
            host_dic["tags_joined"] = ",".join(host_dic["tags"])

    if request_wants_json():
        return Response(json.dumps(hosts), mimetype="application/json")

    return render_template('hosts.html',
                           hosts=hosts,
                           use_cc_data=False,
                           page=page)
Пример #8
0
def known_data(page=1):

    hosts = hosts_handler(page=int(page), which_collection="known-data")

    return render_template('data.html', hosts=hosts, use_known_data=True)
Пример #9
0
def cc_data(page=1):

    hosts = hosts_handler(page=int(page), which_collection="cc-crawl-data")

    return render_template('data.html', hosts=hosts, use_cc_data=True)