Parsing responses from the syncupdates-API
Moritz Lenz moritz.lenz at noris.de
Fri Jan 11 10:20:50 CET 2013
Hi all, for my current work I occasionally patch the Net::Whois::Object Perl module (http://search.cpan.org/perldoc?Net%3A%3AWhois%3A%3AObject) which supports talking to the RIPE syncupdates API. Now I'm facing the challenge of parsing the response when creating an object. For example when creating a new handle, the response used to include something along the lines of *** Info: Authorisation for [TS34027-RIPE] from which I could easily extract the handle (which I don't know in advance, because the request I sent contained AUTO-1 as the handle). Now the response doesn't include that information anymore, and instead I get Create SUCCEEDED: [person] TS34027-RIPE Thomas Schoeller from which I don't know how to extract the new handle. I've considered simply using the first word after the [person] block (as regex, \[.*?\]\s+(\S+) or something similar), but that won't work for an inetnum, where the primary key contains spaces. Is there any robust approach on how to extract the primary key from the response? (If person records are the only ones where the primary key is generated from the database, I can special-case that, but it still feels rather fragile). Cheers, Moritz P.S. I should add that so far, I've been pretty amazed by the quality of responses on this mailing list, and from RIPE in general. Thanks everybody, and keep up the good work!
[ db-help Archive ]