Answer the question
In order to leave comments, you need to log in
Need advice from someone who has worked with the Regru::API perl module?
Need advice from someone who has worked with this module.
In general, the question is quite simple, but I can’t figure out how to get to the data.
There is a code.
#!/usr/bin/perl
use Regru::API;
use Data::Dumper;
my $client = Regru::API->new(
username => "test",
password => "test"
);
my $params = { show_renew_data => 1, show_update_data => 1};
$resp = $client->domain->get_prices( $params );
if ($resp->is_success) {
%prices = $resp->get("prices"); /// А вот как тут правильно дальше - не пойму.
};
Answer the question
In order to leave comments, you need to log in
Ripped it off myself. Here is a working version, maybe someone will need it
#!/usr/bin/perl
use utf8;
binmode(STDOUT,':utf8');
use Regru::API;
use Data::Dumper;
use JSON;
my $client = Regru::API->new(
username => "test",
password => "test"
);
my $params = { show_renew_data => 1, show_update_data => 1};
$resp = $client->domain->get_prices( $params );
if ($resp->is_success) {
foreach $dom ( keys $resp->answer->{'prices'}) {
print $dom;
print "\t";
$reg_price = $resp->answer->{'prices'}{$dom}{'reg_price'};
print $reg_price;
print "\t";
$retail_reg_price = $resp->answer->{'prices'}{$dom}{'retail_reg_price'};
print $retail_reg_price;
print "\n";
};
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question