view release on metacpan or search on metacpan
lib/App/GitHub/update.pm view on Meta::CPAN
my $uri = "https://github.com/api/v2/json/repos/show/$login/$repository";
my $response = $agent->post( $uri,
[ login => $login, token => $token, @arguments ] );
unless ( $response->is_success ) {
die $response->status_line, "\n", $response->decoded_content, "\n";
}
return $response;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Github/Email.pm view on Meta::CPAN
my $ua = LWP::UserAgent->new;
my $get_json =
$ua->get("https://api.github.com/users/$username/events/public");
if ( $get_json->is_success ) {
my $raw_json = $get_json->decoded_content;
my $dec_json = decode_json $raw_json;
my @push_events = grep { $_->{type} eq 'PushEvent' } @{$dec_json};
my @commits = map { @{$_->{payload}->{commits}} } @push_events;
my @addresses = map { $_->{author}->{email} } @commits;
my @unique_addr = uniq @addresses;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Glacier/Bre.pm view on Meta::CPAN
my $ua = LWP::UserAgent->new(timeout => 10);
my $response = $ua->get($istore_base_url . $istore_document_path);
unless ($response->is_success) {
return undef;
}
my $doc = JSON->new->decode($response->decoded_content);
return $doc->{region};
}
sub _get_instore_creds {
my $ua = LWP::UserAgent->new(timeout => 10);
my $url = $istore_base_url . $istore_credentials_path;
my $response = $ua->get($url);
unless ($response->is_success) {
return undef;
}
chomp(my $name = $response->decoded_content);
$url .= $name;
$response = $ua->get($url);
unless ($response->is_success) {
return undef;
}
my $doc = JSON->new->decode($response->decoded_content);
return ($doc->{AccessKeyId}, $doc->{SecretAccessKey}, $doc->{Token});
}
# Fix bugs in Net::Amazon::Glacier 0.15
if (version->parse($Net::Amazon::Glacier::VERSION) <= version->parse('0.15')) {
lib/App/Glacier/Bre.pm view on Meta::CPAN
my $res = $self->_send_receive(
GET => "/-/vaults?limit=10" . ($marker ? '&marker='.$marker : '')
);
# updated error severity
croak 'list_vaults failed with error ' . $res->status_line unless $res->is_success;
my $decoded = $self->_decode_and_handle_response( $res );
push @vaults, @{$decoded->{VaultList}};
$marker = $decoded->{Marker};
} while ( $marker );
return ( \@vaults );
}
view all matches for this distribution
view release on metacpan or search on metacpan
setup/import_export/perl.pl view on Meta::CPAN
my ($base_name, $path, $extension) = File::Basename::fileparse($file, ('\..*')) ;
my $file_name = $base_name . $extension ;
my ($base64_data, $header, $footer) = get_base64_data($file_name) ;
my $decoded_base64 = MIME::Base64::decode($base64_data);
my $self_to_resurect = decompress($decoded_base64) ;
my $VAR1 ;
my $resurected_self = eval $self_to_resurect ;
die $@ if $@ ;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/HTTP_Proxy_IMP/IMP.pm view on Meta::CPAN
$pass >= $orig_clen + $orig_hlen )) {
# no need to decode body
$self->{decode}{IMP_DATA_HTTPRQ_CONTENT+0}[1] = undef;
}
} else {
# content is encoded and inspection wants to see decoded stuff,
# which we then will forward too
# but decoding might change length
$clen = undef;
# the content will be delivered decoded
delete $xhdr->{fields}{'content-encoding'}
}
}
if ( defined $clen ) {
$xhdr->{fields}{'content-length'} = [ $clen ];
lib/App/HTTP_Proxy_IMP/IMP.pm view on Meta::CPAN
$self->{decode}{$type+0}[$dir] = $decode = _create_decoder($decode)
|| return $self->{request}->fatal(
"cannot decode content-encoding $decode");
}
# offsets relates to original stream, but we put the decoded stream
# into ibuf. And offset>0 means, that we have a gap in the input,
# which is not allowed, when decoding a stream.
die "cannot use content decoder with gap in data" if $offset;
$encoded_data = $data if $self->{pass_encoded}[$dir];
view all matches for this distribution
view release on metacpan or search on metacpan
script/kgb-bot view on Meta::CPAN
unless ($ok) {
return webhook_error(@_, 'Error decoding JSON body', undef, $@);
}
KGB->debug('Body decoded');
unless (
$json
and ref($json)
and ref($json) eq 'HASH'
script/kgb-bot view on Meta::CPAN
=head2 gitlab_webhook_push
Handle a gitlab webhook call for the C<push> event (branch update).
Expects the body of the POST request (decoded, as a hash reference) in I<ARG0>
and all the request parameters in I<ARG1>.
The request is expected to conform to the GitLab webhook documentation at
L<https://salsa.debian.org/help/user/project/integrations/webhooks.md#push-events>.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/kamstrup-kem-split.pl view on Meta::CPAN
./kamstrup-kem-split.pl --key=<key> [--config=<configfile> --kem=1] inputfile_from_backend
=head1 DESCRIPTION
This script takes as input a delivery file from Kamstrup (encrypted, compressed KEM file), unpacks it and splits the file into different
decoded XML files that can be further processed.
Minimal input to the script are the encryption key and the input file. If no further configuration file is passed then all information
in the input file is written to the output file.
A configuration file consists of a CSV file with `;` as delimeter and the following columns:
view all matches for this distribution
view release on metacpan or search on metacpan
kritika.fatpack view on Meta::CPAN
codeset range. Neither of these flags conflict with each other, although
some combinations make less sense than others.
Care has been taken to make all flags symmetrical with respect to
C<encode> and C<decode>, that is, texts encoded with any combination of
these flag values will be correctly decoded when the same flags are used
- in general, if you use different flag settings while encoding vs. when
decoding you likely have a bug somewhere.
Below comes a verbose discussion of these flags. Note that a "codeset" is
simply an abstract set of character-codepoint pairs, while an encoding
kritika.fatpack view on Meta::CPAN
=item C<utf8> flag disabled
When C<utf8> is disabled (the default), then C<encode>/C<decode> generate
and expect Unicode strings, that is, characters with high ordinal Unicode
values (> 255) will be encoded as such characters, and likewise such
characters are decoded as-is, no changes to them will be done, except
"(re-)interpreting" them as Unicode codepoints or Unicode characters,
respectively (to Perl, these are the same thing in strings unless you do
funny/weird/dumb stuff).
This is useful when you want to do the encoding yourself (e.g. when you
view all matches for this distribution
view release on metacpan or search on metacpan
Paul Gevers++
v3.2.13 2021-10-11
[ Bug Fixes ]
- fix encoding tests flag as TODO tests using undecoded input:
String::Copyright documented to accept only strings
Adrian Bunk++
[ Test Suite ]
- tighten test to not fail with old String::Copyright
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MFILE/WWW/Resource.pm view on Meta::CPAN
# request is ready - send it and get response
my $response = $ua->request( $r );
# process response
my $body_json = $response->decoded_content;
$log->debug( "rest_req: decoded JSON body " . Dumper $body_json );
$response->content('');
my $body;
try {
$body = JSON->new->decode( $body_json );
} catch {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MFILE/HTTP.pm view on Meta::CPAN
# request is ready - send it and get response
my $response = $ua->request( $r );
# process response
my $body_json = $response->decoded_content;
$log->debug( "rest_req: decoded JSON body " . Dumper $body_json );
$response->content('');
my $body;
try {
$body = JSON->new->decode( $body_json );
} catch {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MHFS.pm view on Meta::CPAN
$torrent{'private'} = $6;
if($is_unicode) {
my $escaped_unicode = $torrent{'name'};
$torrent{'name'} =~ s/\\u(.{4})/chr(hex($1))/eg;
$torrent{'name'} =~ s/\\x(.{2})/chr(hex($1))/eg;
my $decoded_as = $torrent{'name'};
$torrent{'name'} = ${escape_html($torrent{'name'})};
if($qs->{'logunicode'}) {
say 'unicode escaped: ' . $escaped_unicode;
say 'decoded as: ' . $decoded_as;
say 'html escaped ' . $torrent{'name'};
}
}
$buf .= '<tr><td>' . $torrent{'name'} . '</td><td>' . $torrent{'hash'} . '</td><td>' . $torrent{'size_bytes'} . '</td><td>' . $torrent{'bytes_done'} . '</td><td>' . $torrent{'private'} . '</td></tr>';
$curtor = '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Maisha.pm view on Meta::CPAN
my $list = Config::Any->load_files( { files => [ $filename ], use_ext => 1 } );
($config) = $list->[0]->{$filename};
}
croak("Could not load configuration file") if(!$config);
croak("Maisha expectes a config file that can be decoded to a HASH") if(ref $config ne 'HASH');
# some systems use a broken pager, so force the internal parser to be used
$self->{pager} = $ENV{PAGER};
$ENV{PAGER} = '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MatrixTool/HTTPClient.pm view on Meta::CPAN
my ( $response ) = @_;
$response->content_type eq "application/json" or
return Future->fail( "Expected an application/json response body", matrix => );
Future->done( decode_json( $response->decoded_content ), $response );
});
}
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MonM/Checkit/HTTP.pm view on Meta::CPAN
# Request
my $response = $ua->request($request);
# Result
$self->status(($response->is_info || $response->is_success || $response->is_redirect) ? 1 : 0);
$self->error($response->decoded_content // '') unless $self->status;
$self->source(sprintf("%s %s", $method, $response->request->uri->canonical->as_string));
$self->message($response->status_line || '');
$self->code($response->code || 0);
$self->content($response->decoded_content // '');
return;
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MtAws/ConfigEngine.pm view on Meta::CPAN
sub decode_option_value
{
my ($self, $val) = @_;
my $enc = $self->{cmd_encoding}||confess;
my $decoded = eval {decode($enc, $val, Encode::DIE_ON_ERR|Encode::LEAVE_SRC)};
error("options_encoding_error", encoding => $enc) unless defined $decoded;
$decoded;
}
sub decode_config_value
{
my ($self, $val) = @_;
my $enc = $self->{cfg_encoding}||confess;
my $decoded = eval {decode($enc, $val, Encode::DIE_ON_ERR|Encode::LEAVE_SRC)};
error("config_encoding_error", encoding => $enc) unless defined $decoded;
$decoded;
}
sub get_encoding
{
my ($name, $config, $options) = @_;
lib/App/MtAws/ConfigEngine.pm view on Meta::CPAN
(a => $optref->{original_option}, b => $_->{name}) :
(b => $optref->{original_option}, a => $_->{name})
)
if ((defined $optref->{value}) && !$optref->{list} && $optref->{source} eq 'option' );
my $decoded;
if ($optref->{binary}) {
$decoded = $_->{value};
} else {
$decoded = $self->decode_option_value($_->{value});
last unless defined $decoded;
}
if ($optref->{list}) {
if (defined $optref->{value}) {
push @{ $optref->{value} }, $decoded;
} else {
@{$optref}{qw/value source/} = ([ $decoded ], 'list');
}
push @{$self->{option_list} ||= []}, { name => $optref->{name}, value => $decoded };
} else {
# fill from options from command line
@{$optref}{qw/value source original_option is_alias/} = ($decoded, 'option', $_->{name}, $is_alias);
}
}
}
my $command = undef;
lib/App/MtAws/ConfigEngine.pm view on Meta::CPAN
if ($optref) {
if ($optref->{list}) {
error('list_options_in_config', option => $_);
} elsif (!defined $optref->{value}) {
# fill from config
my $decoded = $optref->{binary} ? $cfg->{$_} : $self->decode_config_value($cfg->{$_});
last unless defined $decoded;
@{$optref}{qw/value source/} = ($decoded, 'config'); # TODO: support for array options??
}
} else {
error('unknown_config_option', option => $_);
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ChordPro/Config.pm view on Meta::CPAN
}
return $cfg;
}
# Get the decoded contents of a single config file.
sub get_config ( $file ) {
Carp::confess("FATAL: Undefined config") unless defined $file;
my $verbose = $options->{verbose};
warn("Reading: $file\n") if $verbose > 1;
$file = expand_tilde($file);
view all matches for this distribution
view release on metacpan or search on metacpan
public/javascripts/ace/mode-php.js view on Meta::CPAN
"object imap_mailboxmsginfo(resource stream_id)",
"Returns info about the current mailbox"
],
"imap_mime_header_decode": [
"array imap_mime_header_decode(string str)",
"Decode mime header element in accordance with RFC 2047 and return array of objects containing 'charset' encoding and decoded 'text'"
],
"imap_msgno": [
"int imap_msgno(resource stream_id, int unique_msg_id)",
"Get the sequence number associated with a UID"
],
view all matches for this distribution
view release on metacpan or search on metacpan
share/public/swagger-ui/swagger-ui-bundle.js.map view on Meta::CPAN
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 396b8c743e9ffbc09e47","webpack:///./node_modules/react/react.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/babel-run...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Nopaste/Service/Perlbot.pm view on Meta::CPAN
unless ($res->is_success) {
return (0, "Failed to get channels, try again later.\n");
}
my $response = decode_json $res->decoded_content;
my $output="Channels supported by perl.bot, all values subject to change.\n-----------------------------------\n";
for my $channel (@{$response->{channels}}) {
$output .= sprintf "%15s %20s\n", $channel->{name}, $channel->{description};
}
lib/App/Nopaste/Service/Perlbot.pm view on Meta::CPAN
$arg{chan} ? (chan => $arg{chan}) : (),
language => $arg{lang} || 'text'
});
if ($res->is_success()) {
my $content = $res->decoded_content;
my $data = decode_json $content;
return (1, $data->{url});
} else {
return (0, "Paste failed");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Nopaste/Service/Gist.pm view on Meta::CPAN
$request->authorization_basic($username, $password);
$request->content(encode_json($parameters));
my $response = $ua->request($request);
my $response_content = decode_json($response->decoded_content);
if ($response_content->{token} ) {
print "GITHUB_OAUTH_TOKEN=$response_content->{token}\n";
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Office/Contacts.pm view on Meta::CPAN
This helps me fight the dread utf8.
=item o utf8.2.pl
This prints singly- and doubly-encoded and decoded string, as a debugging aid.
=back
=head1 TODO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Oozie/Deploy/Validate/Meta.pm view on Meta::CPAN
};
if ( $reason && $what && $self->verbose ) {
require Data::Dumper;
my $d = Data::Dumper->new([ $what], ['*META_YML'] );
$self->logger->debug( sprintf'Raw decoded content without type checks: %s', $d->Dump );
}
return $reason;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/PAUSE/cleanup.pm view on Meta::CPAN
print "> Logging in as $username\n";
my $response = $agent->get( 'https://pause.perl.org/pause/authenquery?ACTION=delete_files' );
my @filelist = $self->parse_filelist( $response->decoded_content );
if ( $dump ) {
print join "\n", map { $_->{package_version} } @filelist;
print "\n";
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/PM/Announce/Feed/meetup.pm view on Meta::CPAN
die "Unable to fetch image at $uri" unless $response->is_success;
die "File at $uri doesn't seem to be an image" unless my ($extension) = $response->header( 'Content-Type' ) =~ m/image\/(.*)/;
# $extension = "jpg";
my $image = File::Temp->new( UNLINK => 0, SUFFIX => ".$extension" );
$self->logger->debug( "Saving image to $image" );
print $image $response->decoded_content;
close $image or warn $!;
$self->logger->debug( "Saved " . -s "$image" );
return $image;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Phoebe/Capsules.pm view on Meta::CPAN
print_link($stream, $host, $capsule_space, $dir, $dir); # must provide $id to avoid page/ prefix
};
return 1;
}
# capsule is already decoded and gets encoded again
sub capsule_dir {
my $host = shift;
my $capsule = shift;
my $dir = $server->{wiki_dir};
if (keys %{$server->{host}} > 1) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Photobear.pm view on Meta::CPAN
while ($response->is_redirect) {
my $redirect_url = $response->header('Location');
$response = $ua->get($redirect_url);
}
return $response->decoded_content;
};
if ($@) {
# Fallback to system curl command
eval {
lib/App/Photobear.pm view on Meta::CPAN
($? & 127), ($? & 128) ? 'with' : 'without');
} elsif ($? >> 8) {
Carp::croak("[photobear]", sprintf("Child exited with value %d\n", $? >> 8));
}
my $decoded_content = decode_json($output);
return $decoded_content;
}
sub download {
my ($url, $dest) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
script/pick view on Meta::CPAN
# }
#
# \@argv;
#}
#
## return ($err, $res, $decoded_val)
#sub _parse_raw_value {
# my ($self, $val, $needs_res) = @_;
#
# if ($val =~ /\A!/ && $self->{enable_encoding}) {
#
script/pick view on Meta::CPAN
#
# if ($self->{warn_perl} && !$space && $val =~ /\A>/) {
# $self->_warn("Probably using Perl syntax instead of INI: $line");
# }
#
# # the common case is that value are not decoded or
# # quoted/bracketed/braced, so we avoid calling _parse_raw_value here
# # to avoid overhead
# if ($val =~ /\A["!\\[\{~]/) {
# $_raw_val = $val if $cb;
# my ($err, $parse_res, $decoded_val) = $self->_parse_raw_value($val);
# $self->_err("Invalid value: " . $err) if $err;
# $val = $decoded_val;
# } else {
# $_raw_val = $val if $cb;
# $val =~ s/\s*[#;].*//; # strip comment
# }
#
script/pick view on Meta::CPAN
#C<section> (str, section name).
#
#=item * Found a key line
#
#Arguments passed: C<event> (str, 'section'), C<linum>, C<line>, C<cur_section>,
#C<key> (str, key name), C<val> (any, value name, already decoded if encoded),
#C<raw_val> (str, raw value).
#
#=back
#
#TODO: callback when there is merging.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Presto/Client.pm view on Meta::CPAN
if ( $h->can_deserialize($content_type) ) {
return $h->deserialize( $response->content );
}
}
}
return $response->decoded_content;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/RetroPAN.pm view on Meta::CPAN
"Accept" => "text/json"
], encode_json($q) );
my $res = $ua->request($req);
die $res->status_line if !$res->is_success;
my $data = decode_json($res->decoded_content);
my $hit = $data->{hits}->{hits}->[0];
if (!defined $hit) {
warn "could not find $au/$dist";
return;
}
lib/App/RetroPAN.pm view on Meta::CPAN
"Accept" => "text/json"
], encode_json($q) );
my $res = $ua->request($req);
die $res->status_line if !$res->is_success;
my $data = decode_json($res->decoded_content);
my $author;
my $version = -1;
my $release;
view all matches for this distribution