def dotransform(request, response): domain = request.value results = query('-r', domain, 0, 'n') for result in results: data = json.loads(result) if data.has_key('time_first'): first = data['time_first'] last = data['time_last'] elif data.has_key('zone_time_first'): first = data['zone_time_first'] last = data['zone_time_last'] fnice = datetime.datetime.fromtimestamp( int(first)).strftime('%m-%d-%Y') lnice = datetime.datetime.fromtimestamp(int(last)).strftime('%m-%d-%Y') if data['rrtype'] == 'NS': for item in data['rdata']: e = NSRecord(item) e.linklabel = fnice + ' - ' + lnice response += e elif data['rrtype'] == 'MX': for item in data['rdata']: e = MXRecord(item) e.linklabel = fnice + ' - ' + lnice response += e elif data['rrtype'] == 'CNAME': for item in data['rdata']: e = Domain(item.rstrip('.')) e.linklabel = fnice + ' - ' + lnice response += e elif data['rrtype'] == 'A': pass else: type = data['rrtype'] for item in data['rdata']: label = type + ' ' + item e = Phrase(label) e.linklabel = fnice + ' - ' + lnice response += e return response
def dotransform(request, response): domain = request.value results = query("-r", domain, 0, "n") for result in results: data = json.loads(result) if data.has_key("time_first"): first = data["time_first"] last = data["time_last"] elif data.has_key("zone_time_first"): first = data["zone_time_first"] last = data["zone_time_last"] fnice = datetime.datetime.fromtimestamp(int(first)).strftime("%m-%d-%Y") lnice = datetime.datetime.fromtimestamp(int(last)).strftime("%m-%d-%Y") if data["rrtype"] == "NS": for item in data["rdata"]: e = NSRecord(item) e.linklabel = fnice + " - " + lnice response += e elif data["rrtype"] == "MX": for item in data["rdata"]: e = MXRecord(item) e.linklabel = fnice + " - " + lnice response += e elif data["rrtype"] == "CNAME": for item in data["rdata"]: e = Domain(item.rstrip(".")) e.linklabel = fnice + " - " + lnice response += e elif data["rrtype"] == "A": pass else: type = data["rrtype"] for item in data["rdata"]: label = type + " " + item e = Phrase(label) e.linklabel = fnice + " - " + lnice response += e return response
def dotransform(request, response): ns = request.value results = query('-n', ns, 0, 'n') for result in results: data = json.loads(result) if data.has_key('rrname'): if data.has_key('time_first'): first = data['time_first'] last = data['time_last'] elif data.has_key('zone_time_first'): first = data['zone_time_first'] last = data['zone_time_last'] fnice = datetime.datetime.fromtimestamp(int(first)).strftime('%m-%d-%Y') lnice = datetime.datetime.fromtimestamp(int(last)).strftime('%m-%d-%Y') e = Domain(data['rrname'].rstrip('.')) e.linklabel = fnice + ' - ' + lnice response += e return response
def dotransform(request, response): domain = request.value results = query('-r', domain, 0, 'n') for result in results: data = json.loads(result) if data.has_key('time_first'): first = data['time_first'] last = data['time_last'] elif data.has_key('zone_time_first'): first = data['zone_time_first'] last = data['zone_time_last'] fnice = datetime.datetime.fromtimestamp(int(first)).strftime('%m-%d-%Y') lnice = datetime.datetime.fromtimestamp(int(last)).strftime('%m-%d-%Y') if data['rrtype'] == 'A': for item in data['rdata']: e = IPv4Address(item) e.linklabel = fnice + ' - ' + lnice response += e return response
def dotransform(request, response): ns = request.value results = query('-n', ns, 0, 'n') for result in results: data = json.loads(result) if data.has_key('rrname'): if data.has_key('time_first'): first = data['time_first'] last = data['time_last'] elif data.has_key('zone_time_first'): first = data['zone_time_first'] last = data['zone_time_last'] fnice = datetime.datetime.fromtimestamp( int(first)).strftime('%m-%d-%Y') lnice = datetime.datetime.fromtimestamp( int(last)).strftime('%m-%d-%Y') e = Domain(data['rrname'].rstrip('.')) e.linklabel = fnice + ' - ' + lnice response += e return response
def dotransform(request, response): domain = request.value results = query('-r', domain, 0, 'n') for result in results: data = json.loads(result) if data.has_key('time_first'): first = data['time_first'] last = data['time_last'] elif data.has_key('zone_time_first'): first = data['zone_time_first'] last = data['zone_time_last'] fnice = datetime.datetime.fromtimestamp( int(first)).strftime('%m-%d-%Y') lnice = datetime.datetime.fromtimestamp(int(last)).strftime('%m-%d-%Y') if data['rrtype'] == 'A': for item in data['rdata']: e = IPv4Address(item) e.linklabel = fnice + ' - ' + lnice response += e return response