@@ -0,0 +1,1001 @@
+#!/usr/bin/env python%0A%0Aimport sys%0Aimport urllib2%0Afrom BaseHTTPServer import BaseHTTPRequestHandler%0A%0Afrom apikey import APIKEY%0Afrom regrws import OrgPayload, ErrorPayload%0A%0Aif len(sys.argv) != 2:%0A    print 'Usage: %25s ORGHANDLE' %25 sys.argv%5B0%5D%0A    sys.exit(2)%0A%0Aorghandle = sys.argv%5B1%5D%0Aurl = 'https://reg.arin.net/rest/org/%25s?apikey=%25s' %25 (orghandle, APIKEY)%0Atry:%0A    response = urllib2.urlopen(url).read()%0Aexcept urllib2.HTTPError as exc:%0A    errorpayload = ErrorPayload.parseString(exc.read())%0A    print errorpayload.message%0A    sys.exit(1)%0Aelse:%0A    orgpayload = OrgPayload.parseString(response)%0A    print '''%0AName: %25s%0AHandle: %25s%0ARegistration date: %25s%0A''' %25 (orgpayload.orgName%5B0%5D,%0A       orgpayload.handle%5B0%5D,%0A       orgpayload.registrationDate%5B0%5D)%0A    for line in orgpayload.streetAddress%5B0%5D.get_line():%0A        print line.get_valueOf_()%0A    print '''%25s, %25s %25s%0A%25s''' %25 (orgpayload.city%5B0%5D,%0A         orgpayload.iso3166_2%5B0%5D,%0A         orgpayload.postalCode%5B0%5D,%0A         orgpayload.iso3166_1%5B0%5D.name%5B0%5D)%0A

add org_get