Created
September 30, 2015 08:59
-
-
Save emileaben/61223301b69863c9d4ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import fileinput | |
from ripe.atlas.sagan import DnsResult | |
def process(line): | |
result = DnsResult(line) | |
try: | |
print("{}\t{}\t{}\t{}".format( | |
result.created.strftime('%s'), | |
result.probe_id, | |
result.responses[0].response_time, | |
result.responses[0].abuf.answers[0].data[0] | |
) | |
) | |
except: | |
pass # brutal | |
for line in fileinput.input(): | |
process(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment