Example #1
0
def visited_domains():
    try:
        frm, to = get_visited_domains_params(request.args, ("from", "to"))
    except Exception as e:
        return make_json_response(error=e, code=HTTPStatus.BAD_REQUEST)

    try:
        data = redis_connector.get_by_range(frm, to)
    except Exception as e:
        return make_json_response(status=ERROR_INTERNAL, code=HTTPStatus.INTERNAL_SERVER_ERROR)

    links = Links(data)
    return make_json_response(key=DOMAINS_KEY, data=links.get_domains())