Created
December 10, 2018 15:24
-
-
Save sdstrowes/dcf302f60e12f2597c4947fcb256fb2c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from ripe.atlas.cousteau import AtlasStream | |
import json | |
import sys | |
def on_result_response(*args): | |
print json.dumps(args[0], indent=2) | |
def main(): | |
atlas_stream = AtlasStream() | |
atlas_stream.connect() | |
channel = "atlas_result" | |
atlas_stream.bind_channel(channel, on_result_response) | |
stream_parameters = {"prb": sys.argv[1], "type": "traceroute"} | |
atlas_stream.start_stream(stream_type="result", **stream_parameters) | |
atlas_stream.timeout() | |
atlas_stream.disconnect() | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print "provide a probe ID" | |
sys.exit(1) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment