Skip to content

Instantly share code, notes, and snippets.

@sdstrowes
Created December 10, 2018 15:24
Show Gist options
  • Save sdstrowes/dcf302f60e12f2597c4947fcb256fb2c to your computer and use it in GitHub Desktop.
Save sdstrowes/dcf302f60e12f2597c4947fcb256fb2c to your computer and use it in GitHub Desktop.
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