Result:
found more than 870 distributions - search limited to the first 2001 files matching your query ( run in 1.463 )


App-Nopaste-Service-Perlbot

 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


App-Office-Contacts

 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


App-Oozie

 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


App-PAUSE-cleanup

 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


App-PM-Announce

 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


App-Phoebe

 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


App-Photobear

 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


App-PickRandomLines

 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


App-Presto

 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


App-Project-Doctor

 view release on metacpan or  search on metacpan

t/function.t  view on Meta::CPAN

		),
	);
	my $json = $r->render_json;
	returns_ok($json, { type => 'scalar' }, 'render_json returns a scalar');
	require JSON::MaybeXS;
	my $decoded = JSON::MaybeXS->new->decode($json);
	is ref $decoded, 'ARRAY', 'decodes to arrayref';
	ok !exists $decoded->[0]{fix}, 'fix not serialised';
	is $decoded->[0]{check_name}, 'Meta', 'check_name present';
};

subtest 'Report::render_tap -- plan and ok/not-ok lines' => sub {
	my $r = _make_report(
		_make_finding(severity => $PASS_SEV, message => 'good', check_name => 'A'),

 view all matches for this distribution


App-Raider

 view release on metacpan or  search on metacpan

lib/App/Raider/WebTools.pm  view on Meta::CPAN

      return $tool->text_result("Error: $@", 1) if $@;
      unless ($resp->is_success) {
        return $tool->text_result(
          sprintf("HTTP %s for %s", $resp->status_line, $url), 1);
      }
      my $body = $resp->decoded_content // '';
      if (length($body) > $max_fetch_bytes) {
        $body = substr($body, 0, $max_fetch_bytes) . "\n[truncated]\n";
      }
      my $ctype = $resp->header('Content-Type') // '';
      if (!$in->{as_html} && $ctype =~ m{text/html}i) {

 view all matches for this distribution


App-RetroPAN

 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


App-RoboBot

 view release on metacpan or  search on metacpan

lib/App/RoboBot/Plugin/API/Github.pm  view on Meta::CPAN


    return unless $response->is_success;

    my $json;
    eval {
        $json = decode_json($response->decoded_content);
    };

    return if $@;
    return $json;
}

 view all matches for this distribution


App-Scheme79asm

 view release on metacpan or  search on metacpan

lib/App/Scheme79asm.pm  view on Meta::CPAN

Print the length of the memory (as a big-endian 16-bit value),
followed by the memory contents as a sequence of big-endian 16-bit
values to the given filehandle (default STDOUT). Dies if
C<addr_bits + type_bits> is more than 16.

Big-endian 16-bit values can be decoded with C<unpack 'n', $value>.

=item $asm->B<print_verilog>([I<$fh>])

Print a block of Verilog code assigning the memory contents to an
array named C<mem> to the given filehandle (default STDOUT).

 view all matches for this distribution


App-Slackeria

 view release on metacpan or  search on metacpan

lib/App/Slackeria/Plugin/Debian.pm  view on Meta::CPAN

	}

	$self->{conf}->{href} //= 'http://packages.debian.org/sid/%s';
	my $href = sprintf( $self->{conf}->{href}, $self->{conf}->{name} );

	my $html = $reply->decoded_content();
	my $tree = XML::LibXML->load_html(
		string            => $html,
		recover           => 2,
		suppress_errors   => 1,
		suppress_warnings => 1,

 view all matches for this distribution


App-Slaughter

 view release on metacpan or  search on metacpan

lib/Slaughter/Transport/http.pm  view on Meta::CPAN

    my $response = $ua->request($req);
    if ( $response->is_success() )
    {
        $self->{ 'verbose' } &&
          print "\tOK\n";
        return ( $response->decoded_content() );
    }

    #
    #  Failed?
    #

 view all matches for this distribution


App-SocialCalc-Multiplayer

 view release on metacpan or  search on metacpan

socialcalc/Changes.txt  view on Meta::CPAN


2008-11-06:
Added calcorder as a timesliced part of recalc.

2008-11-07:
Added recalc to coded and decoded sheet attributes.
Sheet recalc attribute is now followed, as well as new sheet.recalconce.

2008-11-10:
SpreadsheetControl now has a default status line.
Added recalc button to toolbar.

 view all matches for this distribution


App-SpreadRevolutionaryDate

 view release on metacpan or  search on metacpan

lib/App/SpreadRevolutionaryDate/BlueskyLite.pm  view on Meta::CPAN

    $blob_req->header('Content-Type' => $img_response->header('Content-Type'));
    $blob_req->content($img_response->content);
    my $blob_response = $self->{ua}->request($blob_req);
    return unless $blob_response->is_success;

    my $blob_content = decode_json($blob_response->decoded_content);
    ($card->{thumb}) = $blob_content->{blob};
  }

  return $card;
}

lib/App/SpreadRevolutionaryDate/BlueskyLite.pm  view on Meta::CPAN

  my $uri = URI->new('https://bsky.social/xrpc/com.atproto.identity.resolveHandle');
  $uri->query_form(handle => $account);
  my $response = $self->{ua}->get($uri);
  return if !$response->is_success;

  my $content = decode_json($response->decoded_content);
  return $content->{did};
}

sub _generate_facets {
  my $self = shift;

lib/App/SpreadRevolutionaryDate/BlueskyLite.pm  view on Meta::CPAN

  $req->header('Content-Type' => 'application/json');
  $req->content($json);
  my $response = $self{ua}->request($req);

  if ($response->is_success) {
    my $content = decode_json($response->decoded_content);
    my $did = $content->{did};
    my $access_jwt = $content->{accessJwt};
    $self{ua}->default_header('Authorization' => 'Bearer ' . $access_jwt);
    $self{did} = $did;
  }

lib/App/SpreadRevolutionaryDate/BlueskyLite.pm  view on Meta::CPAN

    $blob_req->header('Content-Type' => $mime_type);
    $blob_req->content($img_bytes);
    my $blob_response = $self->{ua}->request($blob_req);
    return unless $blob_response->is_success;

    my $blob_content = decode_json($blob_response->decoded_content);
    $payload->{record}->{embed} = {
        '$type'    => 'app.bsky.embed.images',
        images => [
            {
                alt => $img_alt,

lib/App/SpreadRevolutionaryDate/BlueskyLite.pm  view on Meta::CPAN

  my $req = HTTP::Request->new('POST', 'https://bsky.social/xrpc/com.atproto.repo.createRecord');
  $req->header('Content-Type' => 'application/json');
  $req->content($json);
  my $response = $self->{ua}->request($req);
  if ($response->is_success) {
      return decode_json($response->decoded_content);
  } else {
      return $response;
  }
}

 view all matches for this distribution


App-Sqitch

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.9992 2015-05-20T23:51:41Z
     - On PostgreSQL, Sqitch now sets the `client_encoding` parameter to
       `UTF8` for its own connection to the database. This ensures that data
       sent to and from the database should always be properly encoded and
       decoded. Users should still set the proper encodings for change scripts
       as appropriate.
     - Fixed test failures due to path differences on Windows.
     - DateTime::TimeZone is now explicitly required in an attempt to head off
       "Cannot determine local time zone" errors.
     - Corrected some typos and thinkos in `sqitchtutorial-oracle`, thanks to

 view all matches for this distribution


App-Tel

 view release on metacpan or  search on metacpan

local/lib/perl5/YAML/Tiny.pm  view on Meta::CPAN


=head2 read_string $string;

The C<read_string> constructor reads YAML data from a character string, and
returns a new C<YAML::Tiny> object containing the parsed content.  If you have
read the string from a file yourself, be sure that you have correctly decoded
it into characters first.

Returns the object on success or throws an error on failure.

=head2 write $filename

 view all matches for this distribution


App-Test-Generator

 view release on metacpan or  search on metacpan

lib/App/Test/Generator/SchemaExtractor.pm  view on Meta::CPAN

# Entry:      $function        - function name string.
#             $signature_expr  - Type::Params
#                                signature expression
#                                string.
#
# Exit:       Returns a decoded JSON hashref
#             containing parameters and returns
#             metadata on success.
#             Returns undef without running anything if
#             allow_signature_exec was not enabled.
#             Croaks on unsafe expressions, timeout,

lib/App/Test/Generator/SchemaExtractor.pm  view on Meta::CPAN

#             _compile_signature_isolated into a
#             standard schema hashref.
#
# Entry:      $meta - hashref with 'parameters'
#                     arrayref and optional
#                     'returns' hashref, as decoded
#                     from the isolated compile
#                     JSON output.
#
# Exit:       Returns a schema hashref with input,
#             output, style, source, _notes, and

 view all matches for this distribution


App-TimeTracker

 view release on metacpan or  search on metacpan

lib/App/TimeTracker/Proto.pm  view on Meta::CPAN


sub _build_config_file_locations {
    my $self = shift;
    my $file = $self->home->file('projects.json');
    if ( -e $file && -s $file ) {
        my $decoded_json;
        try {
            $decoded_json = decode_json( $file->slurp );
        }
        catch {
            error_message( "Could not json decode '%s'.\nError: '%s'", $file, $_ );
            exit 1;
        };
        return $decoded_json;
    }
    else {
        return {};
    }
}

 view all matches for this distribution


App-Twitch

 view release on metacpan or  search on metacpan

lib/App/Twitch.pm  view on Meta::CPAN

	my $event = $request_packet->[1];
	my $response = $response_packet->[0];
	eval {
		if ($response->code == 200) {
			my $extractor = HTML::ExtractContent->new;
			my $content = $response->decoded_content;
			my $title = $event->{entry}->title;
			if (!utf8::is_utf8($content)) {
				$self->logger->debug($self->logger_prefix.'{'.$event->{run_id}.'} No utf8, trying recode content');
				$content = decode("Detect", $content);
			}

 view all matches for this distribution


App-Ylastic-CostAgent

 view release on metacpan or  search on metacpan

lib/App/Ylastic/CostAgent.pm  view on Meta::CPAN

}

sub _service_list {
  my $self = shift;
  return $self->{services} if $self->{services};
  my $list = $self->mech->get($URL{ylastic_service_list})->decoded_content;
  chomp $list;
  return $self->{services} = [split q{,}, $list];
}

sub _start_date {

 view all matches for this distribution


App-ZodiacUtils

 view release on metacpan or  search on metacpan

script/_chinese-zodiac-of  view on Meta::CPAN

#                $rargs->{$arg} //= {};
#                $val_set = 1; $val = $_[2];
#                $rargs->{$arg}{$_[1]} = $val;
#            } else {
#                {
#                    my ($success, $e, $decoded);
#                    ($success, $e, $decoded) = _parse_json($_[1]);
#                    if ($success) {
#                        $val_set = 1; $val = $decoded;
#                        $rargs->{$arg} = $val;
#                        last;
#                    }
#                    ($success, $e, $decoded) = _parse_yaml($_[1]);
#                    if ($success) {
#                        $val_set = 1; $val = $decoded;
#                        $rargs->{$arg} = $val;
#                        last;
#                    }
#                    die "Invalid YAML/JSON in arg '$fqarg'";
#                }

script/_chinese-zodiac-of  view on Meta::CPAN

#            } elsif (defined $extra->{is_neg}) {
#                $go_spec->{$ospec} = sub { $handler->($_[0], 1) };
#            } elsif ($extra->{is_base64}) {
#                $go_spec->{$ospec} = sub {
#                    require MIME::Base64;
#                    my $decoded = MIME::Base64::decode($_[1]);
#                    $handler->($_[0], $decoded);
#                };
#            } else {
#                $go_spec->{$ospec} = $handler;
#            }
#

script/_chinese-zodiac-of  view on Meta::CPAN

#                    warn "Clash of option: $jopt, not added";
#                } else {
#                    my $jospec = "$jopt=s";
#                    my $parsed = {type=>"s", opts=>[$jopt]};
#                    $go_spec->{$jospec} = sub {
#                        my ($success, $e, $decoded);
#                        ($success, $e, $decoded) = _parse_json($_[1]);
#                        if ($success) {
#                            $rargs->{$arg} = $decoded;
#                        } else {
#                            die "Invalid JSON in option --$jopt: $_[1]: $e";
#                        }
#                    };
#                    $specmeta->{$jospec} = {arg=>$arg, fqarg=>$fqarg, is_json=>1, parsed=>$parsed, %$extra};

script/_chinese-zodiac-of  view on Meta::CPAN

#                    warn "Clash of option: $yopt, not added";
#                } else {
#                    my $yospec = "$yopt=s";
#                    my $parsed = {type=>"s", opts=>[$yopt]};
#                    $go_spec->{$yospec} = sub {
#                        my ($success, $e, $decoded);
#                        ($success, $e, $decoded) = _parse_yaml($_[1]);
#                        if ($success) {
#                            $rargs->{$arg} = $decoded;
#                        } else {
#                            die "Invalid YAML in option --$yopt: $_[1]: $e";
#                        }
#                    };
#                    $specmeta->{$yospec} = {arg=>$arg, fqarg=>$fqarg, is_yaml=>1, parsed=>$parsed, %$extra};

script/_chinese-zodiac-of  view on Meta::CPAN

#                        !$is_array_of_simple && !$is_hash_of_simple) {
#                    my $i = 0;
#                    for (@$val) {
#                      TRY_PARSING_AS_JSON_YAML:
#                        {
#                            my ($success, $e, $decoded);
#                            if ($per_arg_json) {
#                                ($success, $e, $decoded) = _parse_json($_);
#                                if ($success) {
#                                    $_ = $decoded;
#                                    last TRY_PARSING_AS_JSON_YAML;
#                                } else {
#                                    warn "Failed trying to parse argv #$i as JSON: $e";
#                                }
#                            }
#                            if ($per_arg_yaml) {
#                                ($success, $e, $decoded) = _parse_yaml($_);
#                                if ($success) {
#                                    $_ = $decoded;
#                                    last TRY_PARSING_AS_JSON_YAML;
#                                } else {
#                                    warn "Failed trying to parse argv #$i as YAML: $e";
#                                }
#                            }

script/_chinese-zodiac-of  view on Meta::CPAN

#                    }
#                }
#                if (!($arg_spec->{slurpy} // $arg_spec->{greedy}) && !$is_simple) {
#                  TRY_PARSING_AS_JSON_YAML:
#                    {
#                        my ($success, $e, $decoded);
#                        if ($per_arg_json) {
#                            ($success, $e, $decoded) = _parse_json($val);
#                            if ($success) {
#                                $val = $decoded;
#                                last TRY_PARSING_AS_JSON_YAML;
#                            } else {
#                                warn "Failed trying to parse argv #$arg_spec->{pos} as JSON: $e";
#                            }
#                        }
#                        if ($per_arg_yaml) {
#                            ($success, $e, $decoded) = _parse_yaml($val);
#                            if ($success) {
#                                $val = $decoded;
#                                last TRY_PARSING_AS_JSON_YAML;
#                            } else {
#                                warn "Failed trying to parse argv #$arg_spec->{pos} as YAML: $e";
#                            }
#                        }

 view all matches for this distribution


App-ZofCMS

 view release on metacpan or  search on metacpan

lib/App/ZofCMS/Plugin/BasicLWP.pm  view on Meta::CPAN


sub _defaults {
    return (
        t_name  => 'plug_basic_lwp',
        t_key   => 'd',
        decoded => 0,
        uri_fix => 0,
        ua_args => [
            agent   => 'Opera 9.2',
            timeout => 30,
        ],

lib/App/ZofCMS/Plugin/BasicLWP.pm  view on Meta::CPAN

    unless ( $response->is_success ) {
        $template->{ $t_key }{ $t_name . '_error' } = $response->status_line;
        return;
    }

    $template->{ $t_key }{ $t_name } = $conf->{decoded}
                                     ? $response->decoded_content
                                     : $response->content;

    return 1;
}

lib/App/ZofCMS/Plugin/BasicLWP.pm  view on Meta::CPAN


    plug_basic_lwp => {
        uri     => 'http://zofdesign.com/', # everything but 'uri' is optional
        t_name  => 'plug_basic_lwp',
        t_key   => 'd',
        decoded => 0,
        fix_uri => 0,
        ua_args => [
            agent   => 'Opera 9.2',
            timeout => 30,
        ],

lib/App/ZofCMS/Plugin/BasicLWP.pm  view on Meta::CPAN

    t_key => 'd',

B<Optional>. Takes a string as a value. Specifies the name of B<first-level> key in ZofCMS
Template hashref in which to create the C<t_name> key (see above). B<Defaults to:> C<d>

=head3 C<decoded>

    decoded => 0,

B<Optional>. Takes either true or false values as a value. When set to a I<true> value,
the content will be given us with C<decoded_content()>. When set to a I<false> value, the
content will be given us with C<content()> method. See L<HTTP::Response> for description
of those two methods. B<Defaults to:> C<0> (use C<content()>)

=head3 C<fix_uri>

 view all matches for this distribution


App-after

 view release on metacpan or  search on metacpan

bin/_after  view on Meta::CPAN

#            } elsif ($is_simple) {
#                $val_set = 1; $val = $_[1];
#                $rargs->{$arg} = $val;
#            } else {
#                {
#                    my ($success, $e, $decoded);
#                    ($success, $e, $decoded) = _parse_json($_[1]);
#                    if ($success) {
#                        $val_set = 1; $val = $decoded;
#                        $rargs->{$arg} = $val;
#                        last;
#                    }
#                    ($success, $e, $decoded) = _parse_yaml($_[1]);
#                    if ($success) {
#                        $val_set = 1; $val = $decoded;
#                        $rargs->{$arg} = $val;
#                        last;
#                    }
#                    die "Invalid YAML/JSON in arg '$fqarg'";
#                }

bin/_after  view on Meta::CPAN

#            } elsif (defined $extra->{is_neg}) {
#                $go_spec->{$ospec} = sub { $handler->($_[0], 1) };
#            } elsif ($extra->{is_base64}) {
#                $go_spec->{$ospec} = sub {
#                    require MIME::Base64;
#                    my $decoded = MIME::Base64::decode($_[1]);
#                    $handler->($_[0], $decoded);
#                };
#            } else {
#                $go_spec->{$ospec} = $handler;
#            }
#

bin/_after  view on Meta::CPAN

#                    warn "Clash of option: $jopt, not added";
#                } else {
#                    my $jospec = "$jopt=s";
#                    my $parsed = {type=>"s", opts=>[$jopt]};
#                    $go_spec->{$jospec} = sub {
#                        my ($success, $e, $decoded);
#                        ($success, $e, $decoded) = _parse_json($_[1]);
#                        if ($success) {
#                            $rargs->{$arg} = $decoded;
#                        } else {
#                            die "Invalid JSON in option --$jopt: $_[1]: $e";
#                        }
#                    };
#                    $specmeta->{$jospec} = {arg=>$arg, fqarg=>$fqarg, is_json=>1, parsed=>$parsed, %$extra};

bin/_after  view on Meta::CPAN

#                    warn "Clash of option: $yopt, not added";
#                } else {
#                    my $yospec = "$yopt=s";
#                    my $parsed = {type=>"s", opts=>[$yopt]};
#                    $go_spec->{$yospec} = sub {
#                        my ($success, $e, $decoded);
#                        ($success, $e, $decoded) = _parse_yaml($_[1]);
#                        if ($success) {
#                            $rargs->{$arg} = $decoded;
#                        } else {
#                            die "Invalid YAML in option --$yopt: $_[1]: $e";
#                        }
#                    };
#                    $specmeta->{$yospec} = {arg=>$arg, fqarg=>$fqarg, is_yaml=>1, parsed=>$parsed, %$extra};

bin/_after  view on Meta::CPAN

#                        !$is_array_of_simple) {
#                    my $i = 0;
#                    for (@$val) {
#                      TRY_PARSING_AS_JSON_YAML:
#                        {
#                            my ($success, $e, $decoded);
#                            if ($per_arg_json) {
#                                ($success, $e, $decoded) = _parse_json($_);
#                                if ($success) {
#                                    $_ = $decoded;
#                                    last TRY_PARSING_AS_JSON_YAML;
#                                } else {
#                                    warn "Failed trying to parse argv #$i as JSON: $e";
#                                }
#                            }
#                            if ($per_arg_yaml) {
#                                ($success, $e, $decoded) = _parse_yaml($_);
#                                if ($success) {
#                                    $_ = $decoded;
#                                    last TRY_PARSING_AS_JSON_YAML;
#                                } else {
#                                    warn "Failed trying to parse argv #$i as YAML: $e";
#                                }
#                            }

bin/_after  view on Meta::CPAN

#                    }
#                }
#                if (!$arg_spec->{greedy} && !$is_simple) {
#                  TRY_PARSING_AS_JSON_YAML:
#                    {
#                        my ($success, $e, $decoded);
#                        if ($per_arg_json) {
#                            ($success, $e, $decoded) = _parse_json($val);
#                            if ($success) {
#                                $val = $decoded;
#                                last TRY_PARSING_AS_JSON_YAML;
#                            } else {
#                                warn "Failed trying to parse argv #$arg_spec->{pos} as JSON: $e";
#                            }
#                        }
#                        if ($per_arg_yaml) {
#                            ($success, $e, $decoded) = _parse_yaml($val);
#                            if ($success) {
#                                $val = $decoded;
#                                last TRY_PARSING_AS_JSON_YAML;
#                            } else {
#                                warn "Failed trying to parse argv #$arg_spec->{pos} as YAML: $e";
#                            }
#                        }

 view all matches for this distribution


App-bovespa

 view release on metacpan or  search on metacpan

lib/App/bovespa.pm  view on Meta::CPAN


    my $response = $ua->get( $url . $query_params );

    my $raw_html;
    if ( $response->is_success ){
        $raw_html = $response->decoded_content;
    }else{
        die;
    }

    my $data = decode_json $raw_html;

 view all matches for this distribution


App-cdnget

 view release on metacpan or  search on metacpan

lib/App/cdnget/Downloader.pm  view on Meta::CPAN

	my $img;
	given ($headers->content_type)
	{
		when ("image/png")
		{
			$img = GD::Image->newFromPngData($response->decoded_content) or $self->throw($!);
		}
		when ("image/jpeg")
		{
			$img = GD::Image->newFromJpegData($response->decoded_content) or $self->throw($!);
		}
		default
		{
			$self->throw("Unsupported content type for image");
		}

lib/App/cdnget/Downloader.pm  view on Meta::CPAN

	$self->throw("Unsupported content type for css") unless $headers->content_type =~ /^(text\/css|application\/x\-pointplus)$/;
	given ($hook)
	{
		when (/^cssminify$/i)
		{
			my $data = CSS::Minifier::XS::minify($response->decoded_content);
			return ("Status: 200\r\nContent-Type: ".$headers->content_type."\r\nContent-Length: ".length($data)."\r\n", $data);
		}
		default
		{
			$self->throw("Unsupported css hook");

lib/App/cdnget/Downloader.pm  view on Meta::CPAN

	$self->throw("Unsupported content type for js") unless $headers->content_type =~ /^(text\/javascript|text\/ecmascript|application\/javascript|application\/ecmascript|application\/x\-javascript)$/;
	given ($hook)
	{
		when (/^jsminify$/i)
		{
			my $data = JavaScript::Minifier::XS::minify($response->decoded_content);
			return ("Status: 200\r\nContent-Type: ".$headers->content_type."\r\nContent-Length: ".length($data)."\r\n", $data);
		}
		default
		{
			$self->throw("Unsupported js hook");

lib/App/cdnget/Downloader.pm  view on Meta::CPAN

		$self->throw("Download failed") if $response->header("Client-Aborted");
		unless ($self->hook)
		{
			unless ($response->is_success)
			{
				$content_cb->($response->decoded_content, $response);
			}
		} else
		{
			if ($response->is_success)
			{

lib/App/cdnget/Downloader.pm  view on Meta::CPAN

					$fh->print($header."\r\n".$data) or $self->throw($!);
				}
			} else
			{
				$response_header->($response, $ua);
				$content_cb->($response->decoded_content, $response);
			}
		}
	};
	do
	{

 view all matches for this distribution


App-cloudconvert

 view release on metacpan or  search on metacpan

lib/App/cloudconvert.pm  view on Meta::CPAN

        $response = $ua->mirror( $response->header('location'), $outputfile );
    } else { 
        my $error = "conversion failed";
        if (!$response->is_success) {
            if ($response->header('content-type') eq 'application/json') {
                my $content = from_json($response->decoded_content);
                $error = $content->{error};
            }
        }
        say STDERR $response->code, ": ", $error;
        return 1;

 view all matches for this distribution


( run in 1.463 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )