use Plack::Request;
use Plack::Response;
use LWP::UserAgent;
use URI::Escape;
use Path::Tiny;
use JSON;
has sites => ( is => 'ro', required => 1 );
has _ports => ( is => 'rw', default => sub {{}} );
ite}->{url};
my $data_file = path($site.'.json');
die "Missing JSON publisher data file for ".$site unless $data_file->is_file;
my $data = decode_json($data_file->slurp_utf8);
my %urls;
for
tch
$App::DuckPAN::Fathead::VERSION = '1021';
use Moo;
with 'App::DuckPAN::HasApp';
use DBI;
use JSON;
use Path::Tiny;
use HTML::TreeBuilder;
use HTML::Element;
use Data::Printer return_value => 'dum
$out->{data} = { %$data, %extra_data };
return $out;
}
# Emulate internal processing to build JSON
# matching DDG API result format
sub _parse_disambiguations {
my ($self, $disambiguations, $out)
$text
};
}
push @out, $result;
}
return \@out;
}
# Emulate internal processing to build JSON
# matching DDG API result format
sub _get_image {
my ($self, $image) = @_;
my $url = "";
if ($
n_value => 'dump';
use HTTP::Request;
use HTTP::Headers;
use LWP::UserAgent;
use URI::Escape;
use JSON;
has blocks => ( is => 'ro', required => 1 );
has page_root => ( is => 'ro', required => 1 );
ha
$to =~ s/\$\{dollar\}/\$/g;
my ($wrap_jsonp_callback, $callback, $wrap_string_callback, $missing_envs, $headers) =
($rewrite->wrap_jsonp_callback, $rewrite->callback, $rewrite->wrap_s
$body;
warn "Cannot use wrap_jsonp_callback and wrap_string callback at the same time!" if $wrap_jsonp_callback && $wrap_string_callback;
if ($wrap_jsonp_callback && $callback) {
$