+use HTTP::Tiny;
+
+my $ht = HTTP::Tiny->new(agent => "Number-Phone-RO/$VERSION ");
+
+sub query_portabilitate {
+ my ($self) = @_;
+ $self->_info->{portabilitate_queried} = 1;
+ my $req = $ht->get("http://portabilitate.ro/ro-no-0$$self");
+ return unless $req->{success};
+ my ($initial_operator) = $req->{content} =~ /lnkOperatorInitial">([^<]*)</x;
+ my ($current_operator) = $req->{content} =~ /lnkOperator">([^<]*)</x;
+ $initial_operator //= $current_operator;
+ $self->_info->{initial_operator} = $initial_operator;
+ $self->_info->{current_operator} = $current_operator;
+}
+
+sub operator {
+ my ($self) = @_;
+ $self->query_portabilitate unless $self->_info->{portabilitate_queried};
+ $self->_info->{initial_operator}
+}
+
+sub operator_ported {
+ my ($self) = @_;
+ $self->query_portabilitate unless $self->_info->{portabilitate_queried};
+ $self->_info->{current_operator}
+}
+