From: Dominik 'R. M. <do...@gr...> - 2006-03-01 14:20:38
|
On Monday, 27 February 2006 at 13:07, David Saez Padros wrote: > Hi !! > > >You're welcome. Note that I didn't actually test it on PHP4, but it > >shouldn't break anything, either. > > it works on php4 Great. > >>Nevertheles i have to point that there is no need to write your own > >>parser for .pl domains as that kind of output could be easely parsed by > >>the current parser routines (you could use get_blocks to get the blocks > >>and then generic_parser_b to get the data for each block) > > > >I'd appreciate some help here, because much as I try to understand the > >code, it seems overly cryptic, which combined with the complete lack of > >documentation leaves me wanting to write my own parser from scratch. > > just take a look at any parser that uses that functions and avoid > looking at the functions code itself, it will show you how to use that > functions (handlers using that functions, almost all, are quite simple > to understand) Yes, the handlers are easy to understand, but my trying to use those functions in a similar way doesn't yield good results. Here's sample output for one of the domains I use, i.e. pekin.waw.pl. ---cut--- % This is the NASK WHOIS Server. % This server provides information only for PL domains. % For more info please see http://www.dns.pl/english/whois.html Domain object: domain: pekin.waw.pl registrant's handle: ont_o50889 (INDIVIDUAL) nservers: ns.pekin.waw.pl.[80.55.44.166] fns2.sgh.waw.pl.[193.111.27.194] created: 2005.08.28 last modified: 2005.08.29 registrar: Onet.pl SA ul. Starowislna 48 31-035 Krakow Polska/Poland +48. 12 2600200 bo...@on... option: the domain name has not option Subscribers Contact object: data restricted registrar: Onet.pl SA ul. Starowislna 48 31-035 Krakow Polska/Poland +48. 12 2600200 bo...@on... Technical Contact: company: Name Lastname street: Somestreet 10 city: 00-000 City location: PL handle: ont_t50878 last modified: 2005.08.29 registrar: Onet.pl SA ul. Starowislna 48 31-035 Krakow Polska/Poland +48. 12 2600200 bo...@on... ---cut--- So I tried to use: $items = array( 'domain' => 'Domain object:', 'owner' => 'Subscribers Contact object', 'tech' => 'Technical Contact' ); $r = get_blocks($data_str, $items); $r["owner"] = get_contact($r["owner"]); $r["tech"] = get_contact($r["tech"]); and $r contains nothing. Any clues will be most welcome. Regards, R. -- The Fremen were supreme in that quality the ancients called "spannungsbogen" -- which is the self-imposed delay between desire for a thing and the act of reaching out to grasp that thing. -- from "The Wisdom of Muad'Dib" by the Princess Irulan |