view release on metacpan or search on metacpan
scripts/get_abundance_profile view on Meta::CPAN
if ($res->is_success){
if ($res->header('Content-Type') eq "application/json") {
my $json = JSON->new->allow_nonref;
my $biom = $json->decode( $res->decoded_content );
# transform biom into plain list
if ($biom->{matrix_type} eq "dense" and $format eq "plain"){
my $counter = 0;
scripts/get_abundance_profile view on Meta::CPAN
$counter++;
exit if ($debug and $counter == 20) ;
}
}
else{
print $res->decoded_content , "\n";
}
}
else{
print $res->decoded_content , "\n";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Phylo/CIPRES.pm view on Meta::CPAN
my $res = $ua->post( $url . '/job/' . $self->user, $load, @head );
if ( $res->is_success ) {
# run submission, parse result
my $status_url;
my $result = $res->decoded_content;
DEBUG $result;
XML::Twig->new(
'twig_handlers' => {
'jobstatus/selfUri/url' => sub { $status_url = $_->text }
}
lib/Bio/Phylo/CIPRES.pm view on Meta::CPAN
my $res = $ua->get( $url, @head );
if ( $res->is_success ) {
# post request, fetch result
my ( $status, $outfiles );
my $result = $res->decoded_content;
DEBUG $result;
XML::Twig->new(
'twig_handlers' => {
'jobstatus/resultsUri/url' => sub { $outfiles = $_->text },
'jobstatus/terminalStage' => sub { $status = $_->text }
lib/Bio/Phylo/CIPRES.pm view on Meta::CPAN
my $ua = $self->ua;
my @head = $self->headers(0);
my $res = $ua->get( $url, @head );
my %out_url;
if ( $res->is_success ) {
my $result = $res->decoded_content;
DEBUG $result;
XML::Twig->new(
'twig_handlers' => {
'results/jobfiles/jobfile' => sub {
my $node = $_;
lib/Bio/Phylo/CIPRES.pm view on Meta::CPAN
for my $name ( keys %out ) {
my $location = $out_url{ $name };
$res = $ua->get( $location, @head );
if ( $res->is_success ) {
open my $fh, '>', $out{ $name } or die $!;
print $fh $res->decoded_content;
}
else {
throw 'NetworkError' => $res->status_line;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Phylo/NeXML/Entities.pm view on Meta::CPAN
Bio::Phylo::NeXML::Entities - Functions for dealing with XML entities
=head1 DESCRIPTION
This package provides subroutines for dealing with characters that need to be
encoded as XML entities, and decoded in other formats. For example: C<&> needs
to be encoded as C<&> in XML. The subroutines have the same signatures and
the same names as those in the commonly-used module L<HTML::Entities>. They are
re-implemented here to avoid introducing dependencies.
=head1 SUBROUTINES
lib/Bio/Phylo/NeXML/Entities.pm view on Meta::CPAN
Decodes XML entities into the characters they code for
Type : Utility function
Title : decode_entities
Usage : my $decoded = decode_entities('string with & or >')
Function: decodes encoded entities in argument string(s)
Returns : Array of decoded strings
Args : One or more encoded strings
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/PhyloTastic/DateLife.pm view on Meta::CPAN
my $response = $ua->get($url);
if ( $response->is_success ) {
$log->info("success: " . $response->status_line);
# read result, this should be a single number
my $age = $response->decoded_content;
chomp($age);
if ( looks_like_number $age ) {
$log->info("age: $age");
return $age;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Polloc/LocusIO/gff3.pm view on Meta::CPAN
The value to decode (str)
=head3 Returns
The decoded value (str)
=cut
sub _gff3_decode {
my($self,$value) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/rest.pl view on Meta::CPAN
sequence => "TCATTATATAATACAGTAGCAACCCTCTATTGTGTGCATCAAAGG",
],
);
unless ($response->is_success) {
die "Request failed: ", $response->status_line, "\n",
$response->decoded_content;
}
my $results = decode_json( $response->decoded_content );
# $results is now an array ref, like the JSON above
print $results->[0]{polyprotein}, "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/Tools/Protparam.pm view on Meta::CPAN
#Check if successful
$self->throw("$url error: ".$response->status_line) unless $response->is_success;
$self->throw("Bad content type at $url ".$response->content_type) unless $response->content_type eq 'text/html';
my $protParamOutput=$response->decoded_content;
$self->{'output'}=$protParamOutput;
return bless $self,$class;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bitcoin/Crypto/Base58.pm view on Meta::CPAN
my $CHECKSUM_SIZE = 4;
sub verify_checksum
{
my ($decoded) = @_;
my $encoded_val = substr $decoded, 0, -$CHECKSUM_SIZE;
my $checksum = substr $decoded, -$CHECKSUM_SIZE;
return unpack('a' . $CHECKSUM_SIZE, hash256($encoded_val)) eq $checksum;
}
signature_for encode_base58 => (
positional => [ByteStr],
lib/Bitcoin/Crypto/Base58.pm view on Meta::CPAN
sub decode_base58
{
my ($base58encoded) = @_;
my $decoded = decode_b58b($base58encoded);
Bitcoin::Crypto::Exception::Base58InputFormat->raise(
'illegal characters in base58 string'
) unless defined $decoded;
return $decoded;
}
signature_for decode_base58check => (
positional => [Str],
);
sub decode_base58check
{
my ($base58encoded) = @_;
my $decoded = decode_base58($base58encoded);
Bitcoin::Crypto::Exception::Base58InputChecksum->raise(
'incorrect base58check checksum'
) unless verify_checksum($decoded);
return substr $decoded, 0, -$CHECKSUM_SIZE;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
t/blitzexecute.t view on Meta::CPAN
my $response = $client->job_status();
ok(!$response->{error}, 'job_status responds without error');
ok($response->{ok}, 'no error on success');
is($response->{_id}, $status->{_id}, 'job id returns correctly');
is($response->{result}{request}{content}, 'content', 'request content was base64 encoded and decoded');
is($response->{result}{response}{content}, 'content', 'response content was base64 encoded and decoded');
}
# integer test
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Contract/Solidity/ABI/Decoder.pm view on Meta::CPAN
=over 4
=back
Returns an array reference containing all decoded values
=head1 AUTHOR
Reginaldo Costa, C<< <refeco at cpan.org> >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/ABI/Decoder.pm view on Meta::CPAN
=over 4
=back
Returns an array reference containing all decoded values
=head1 AUTHOR
Reginaldo Costa <refeco@cpan.org>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/Keystore/Keyfile.pm view on Meta::CPAN
sub import_file {
my ($self, $file_path, $password) = @_;
my $content = read_file($file_path);
my $decoded = $self->_json->decode(lc $content);
return $self->_from_object($decoded, $password);
}
sub _from_object {
my ($self, $object, $password) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/RLP.pm view on Meta::CPAN
my $tx_params = ['0x9', '0x4a817c800', '0x5208', '0x3535353535353535353535353535353535353535', '0xde0b6b3a7640000', '0x', '0x1', '0x', '0x'];
my $encoded = $rlp->encode($params); #ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080
my $encoded_tx_params = 'ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080';
my $decoded = $rlp->decode(pack "H*", $encoded_tx_params); #['0x9', '0x4a817c800', '0x5208', '0x3535353535353535353535353535353535353535', '0xde0b6b3a7640000', '0x', '0x1', '0x', '0x']
=head1 METHODS
=head2 encode
view all matches for this distribution
view release on metacpan or search on metacpan
t/eip1559.t view on Meta::CPAN
'02f901c3820539808009831de2b98080b90170608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b604...
);
my $rlp = Blockchain::Ethereum::RLP->new();
# substring to remove the 02
my $decoded = $rlp->decode(substr($raw_transaction, 1));
is hex $decoded->[-3], 0, 'correct eip155 v value for contract creation transaction';
};
subtest "eth transfer" => sub {
my $transaction = Blockchain::Ethereum::Transaction::EIP1559->new(
t/eip1559.t view on Meta::CPAN
'02f86c820539018009825208943535353535353535353535353535353535353535880de0b6b3a764000080c080a070816c3d026c13a53e98e5dc414398e9dcdf23e440e777114a3e04810e0dfb5da07d732e6b7f847b06d2baed033772d78407da8f4010fa9300df79f2209ba4c7a0'
);
my $rlp = Blockchain::Ethereum::RLP->new();
# substring to remove the 02
my $decoded = $rlp->decode(substr($raw_transaction, 1));
is hex $decoded->[-3], 0, 'correct eip155 v value for contract creation transaction';
};
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/ABI/Decoder.pm view on Meta::CPAN
=over 4
=back
Returns an array reference containing all decoded values
=head1 AUTHOR
REFECO <refeco@cpan.org>
view all matches for this distribution
view release on metacpan or search on metacpan
t/sysinfos/ProxySG-4006060000--20090307-165730UTC.sysinfo view on Meta::CPAN
(summary)
)
)
(exception.content_encoding_error
(contact)
(details "Server response could not be decoded using encoding type returned by server.")
(format)
(help "This is typically caused by a Web Site presenting a content encoding header of one type, and then encoding the data differently.")
(summary "Content Encoding Error")
(http
(code "502")
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bluesky/Poster.pm view on Meta::CPAN
password => $self->{app_password},
}),
);
unless ($res->is_success) {
croak "Login failed: " . $res->status_line . "\n" . $res->decoded_content;
}
$self->{session} = $self->{json}->decode($res->decoded_content);
}
sub post {
my ($self, $text) = @_;
croak "Text is required" unless defined $text;
lib/Bluesky/Poster.pm view on Meta::CPAN
'Authorization' => 'Bearer ' . $self->{session}{accessJwt},
Content => $self->{json}->encode($payload),
);
unless ($res->is_success) {
croak "Post failed: " . $res->status_line . "\n" . $res->decoded_content;
}
return $self->{json}->decode($res->decoded_content);
}
sub _iso8601 {
my $t = shift;
my @gmt = gmtime($t);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BmltClient/ApiClient.pm view on Meta::CPAN
return undef;
} elsif ( (substr($class, 0, 5)) eq 'HASH[') { #hash
if ($class =~ /^HASH\[(.*),(.*)\]$/) {
my ($key_type, $type) = ($1, $2);
my %hash;
my $decoded_data = decode_json $data;
foreach my $key (keys %$decoded_data) {
if (ref $decoded_data->{$key} eq 'HASH') {
$hash{$key} = $self->deserialize($type, encode_json $decoded_data->{$key});
} else {
$hash{$key} = $self->deserialize($type, $decoded_data->{$key});
}
}
return \%hash;
} else {
#TODO log error
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Babelfish.pm view on Meta::CPAN
=item non_unicode_version()
This function returns a printable version of the given string
(with a European value of "printable" C<:-)>. More precisely,
if the string only contains Latin-1 characters, it is returned
decoded from internal Perl format. If the string contains
others characters outside Latin-1, it's converted using
C<Text::Unidecode>.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot.pm view on Meta::CPAN
}
else {
push @r, decode_irc($_);
}
}
#warn Dumper({ decoded => \@r });
return @r;
}
sub charset_encode {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Cobalt/Plugin/YouTube.pm view on Meta::CPAN
logger->debug("youtube_plug_resp_recv for $req_url");
return PLUGIN_EAT_ALL unless $response->is_success;
my $content = $response->decoded_content;
my $html = HTML::TokeParser->new( \$content );
my ($title, $short_url);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Cobalt/IRC/Event/Topic.pm view on Meta::CPAN
This is the L<Bot::Cobalt::IRC::Event::Channel> subclass for channel topic
changes.
=head2 topic
Returns the new channel topic, as an (undecoded and non-stripped)
string.
=head2 stripped
Returns the color- and formatting-stripped topic string.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/IRC/X/Feeds.pm view on Meta::CPAN
for my $url ( @{ $bot->store->get('urls') || [] } ) {
my $res = $ua->get( $url->{url} );
next unless ( $res->is_success );
eval {
$rss->parse( $res->decoded_content );
};
if ($@) {
warn $@;
next;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BrandMeister/API.pm view on Meta::CPAN
my($res) = $ua->request($req);
print('Request status line: '.$res->status_line."\n") if($self->{DEBUG}) ;
if (!$res->is_success) {
return($res->status_line);
};
$self->{_JSONRESPONSEREF} = $jsonresobj->decode($res->decoded_content);
return(0);
};
=head2 json_response
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brightcove/MAPI.pm view on Meta::CPAN
my $url = URI->new($self->read_api_url);
$url->query_form(%$params);
my $res = $self->user_agent->get($url->as_string);
if ($res->is_success) {
return decode_json($res->decoded_content);
} else {
confess $res->status_line;
}
}
lib/Brightcove/MAPI.pm view on Meta::CPAN
Content => [ json => $jsonrpc ]
);
}
if ($res->is_success) {
my $content = $res->decoded_content;
return decode_json($content);
} else {
confess $res->status_line;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.08 2018-06-25 17:03:25+01:00 Europe/London
- Updated for more recent dependancies
0.07 2016-06-30 10:46:21+01:00 Europe/London
- Add role to be consumed by users
- Ensured that data is decoded on receive
0.06 2016-04-22 14:45:38+01:00 Europe/London
- Updated to Broadworks Release 20 SP1
0.05 2015-10-19 11:09:00+01:00 Europe/London
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Browsermob/Server.pm view on Meta::CPAN
my $self = shift;
my $ua = $self->ua;
my $res = $ua->get('http://' . $self->server_addr . ':' . $self->server_port . '/proxy');
if ($res->is_success) {
my $list = from_json($res->decoded_content)->{proxyList};
my @proxies = map {
$_->{port};
} @$list;
view all matches for this distribution
view release on metacpan or search on metacpan
share/stub.pl view on Meta::CPAN
}
close $out;
while ( my $len = read( DATA, my $buf, 4081 ) ) {
my $decoded = MIME::Base64::decode_base64($buf);
syswrite( $in, $decoded ) or die("Failed to syswrite(): $!");
}
close $in;
waitpid( $pid, 0 );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bundle/WATERKIP/CLI/Azure/Password.pm view on Meta::CPAN
my $ua = LWP::UserAgent->new();
$ua->default_header("Authorization", "Bearer $token");
my $res = $ua->get($self->_cli_args->{use_at});
if($res->is_success) {
say $res->decoded_content;
return;
}
say $token;
die $res->status_line;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/BR/CNJ/NumberExtractor.pm view on Meta::CPAN
die $req->status_line if !$req->is_success;
# text/html
if ( $req->header( 'Content-type' ) eq 'text/html' ) {
my $dom = Mojo::DOM->new( $req->decoded_content );
return cnj_extract_numbers( $dom->all_text );
# Everything else
} else {
return cnj_extract_numbers( $req->decoded_content );
}
}
1;
view all matches for this distribution