Hi,
Is it possible to realize feature which tell domain status in custom response?
I've liked to get TRUE if domain exists or FALSE if not.

CommentFileSizeAuthor
#2 whois-963224-ajax_status.patch4.1 KBhelmo

Comments

helmo’s picture

Sure.
The patch in #913280: Integrate with registrar_api module already adds a parameter for the output method to the whois_display_whois function. For this we could probably introduce a 'Boolean' output method.

helmo’s picture

StatusFileSize
new4.1 KB

I've slightly generalised the code from the mentioned patch.

Here is a patch for the 6.x branch in CVS which adds a boolean status and an error field. The same data as available via the json output data.

You should be able to call:

  $result = whois_render_whois($domain_name, 'html_status');
  if (!empty($result['error_html'])) {
     // do some error handling
  } else {
    $registered = $result['regrinfo']['registered'] != 'no';
  }

Could you test this?

To use the ajax method:
On a request to /whois-ajax-status/drupal.org you should get the following json data: { "html": "The domain \x3cem\x3edrupal.org\x3c/em\x3e is registered", "error_html": null, "registered": true }

helmo’s picture

Status: Active » Postponed (maintainer needs more info)

too bad this was never tested further.

Postponing this since I have no need for this functionality and it doesn't apply to 7.x

Please comment if you have a need for this...