Russian  English  All projects

PHP – parse the Whois response text using regular expressions into an array



There are Whois answers of various domain zones (about 200 pieces), it is necessary to write php functions for each zone to parse the information in the response with regular expressions and place the result in an array.

For example, a response like:

DOMAIN NAME: doz.pl

registrant type: organization

nameservers: dns01.netblade.pl.

dns02.netblade.pl.

fns1.42.pl. [79.98.145.34]

created: 2002.07.25 13:00:00

last modified: 2022.01.13 18:04:04

renewal date: 2022.07.24 14:00:00

Converted by a function to an array of the following:

[domain=>doz.pl,
registrant_type=>organization,
nameservers=>[
0 => [ns=>dns01.netblade.pl],
1 => [ns=>dns02.netblade.pl],
2 => [ns=>fns1.42.pl,
ip=>79.98.145.34]
],
created=>2002.07.25 13:00:00,
last_modified=>2022.01.13 18:04:04,
renewal_date=>2022.07.24 14:00:00]

Whois answers can be very different, in some cases it is necessary to bring the dates to the standard form Y-m-d H:i:s, for example, when the date is indicated in the form: Wed Apr 27 08:35:57 2022 or something else.

The work is not difficult for jun, but monotonous, requiring knowledge of regular expressions and attentiveness.

A folder with examples of Whois, on the example of which you will need to analyze the answers - disk.yandex.ru/d/s30-fXvp...

The zones are very different, somewhere there are only 5 parameters, where there are 30, and the answers of some 1 in 1 repeat the structure of others (for example, the answer for .uk and co.uk, org.uk, gov.uk ...), so that you can do ctrl c/ctrl v code.

I evaluate the project in such a way that on average it takes 30 minutes to write 1 function. 200 domain zones = 100 hours.

Based on the estimation of the project time, offer a price.
28.04.2022 12:39



 Answers freelancers