hod,
regexp => qr!$disp_url!,
code => \&display_tail,
);
# Setup a route to return json data of the file
my $data_url = $plugin->data_url;
my $data_method = $plugin->data_method;
N); # Figure out the end of the file
close($IN);
$plugin->app->log( debug => "Returning JSON:" );
$plugin->app->log( debug => "new_curr_pos " . $file_end);
$plugin->app->log( debug =
nterval);
$plugin->app->log( debug => "output " . $output );
# Return JSON
$app->send_as( JSON => { new_curr_pos => $file_end,
interval => $plugin
_dir}, $name );
}
$env->{worker_config_file} = catfile( $config->{tmp_dir}, $jn . '.job.conf.json' );
$env->{worker_env_script} = catfile( $config->{tmp_dir}, join( '.', 'env', $jn, 'pl' ) );
}
dx_item->[0] -> $result_prefix");
jspew( $result_prefix . ".env.json", \%ENV );
jspew( $result_prefix . ".item.json", $idx_item );
sleep 1;
return 1;
},
post_task =>
st like index, prints element(s) to <result_prefix>.item.json.
Additionally, the current environment will be stored in <result_prefix>.env.json.
EXAMPLE CONFIG:
---
input:
- elements:
- a
require Term::ProgressBar;
$progress = Term::ProgressBar->new(
{
name => 'jsonize movie information',
count => scalar @listOfMovieToRetrieve,
remove => 1
);
$movie->myrating( $ref_movies->{$id}->{rating} );
my $json = $movie->toJSON();
$json > io( $destination . '/json/' . $id . '.json' );
$count++;
$progress->update($count) if $progress;
}
estination;
mkdir $destination . '/json';
return;
}
sub getListOfLocalMovieId {
my @listOfLocalMovie = ();
my @content = io( $destination . '/json' )->all();
foreach my $file (@con
rson-in-charge@jabber.example.com
script: /path/to/log/script.pl
Custom scripts will get a json encoded structure passed via stdin. The structure has the form:
{
"subject": "the sub
et.wur.nl',
'job_name' => 'xml_munge1',
'extra' => { 'map' => '../split_test.map.json.gz' },
'mail' => 'joachim.bargsten@wur.nl',
'script_dir' => '/WORKING_DIR/bin',
type hierarchies, etc.
A solution for that was adopted for JSON modules
around 2012 by using references to C<1> or C<0>
blessed into L<JSON::PP::Boolean> which was chosen
as the canonical package for
these objects.
The problem with that was the coupling with L<JSON::PP>
for no apparent good reason. Booleans are independent
of JSON and this association makes little sense
when loading documents in
c Lehmann's L<Types::Serialiser> approached this problem
by creating a common interface used by L<JSON::XS> and L<CBOR::XS>
modules. This module lifts this core concept (including
idea, implementation
idx_item->[0] -> $result_prefix");
jspew( $result_prefix . ".env.json", \%ENV );
jspew( $result_prefix . ".item.json", $idx_item );
sleep 1;
function_that_does_not_exist();
st like index, prints element(s) to <result_prefix>.item.json.
Additionally, the current environment will be stored in <result_prefix>.env.json.
EXAMPLE CONFIG:
---
input:
- elements:
- a
\nplan skip_all => "$m needed for this test" if \$@;};
}
for my $m (qw(Types::Serialiser JSON::PP Cpanel::JSON::XS)) {
for (qw(t/02-basic.t t/03-is-bool.t t/04-to-bool.t)) {
my $t = file(
idx_item->[0] -> $result_prefix");
jspew( $result_prefix . ".env.json", \%ENV );
jspew( $result_prefix . ".item.json", $idx_item );
sleep 1;
die;
},
post_task => sub
st like index, prints element(s) to <result_prefix>.item.json.
Additionally, the current environment will be stored in <result_prefix>.env.json.
EXAMPLE CONFIG:
---
input:
- elements:
- a
package FilmAffinity::Movie;
use strict;
use warnings;
use JSON;
use Encode;
use Readonly;
use Scalar::Util qw(looks_like_number);
use Text::Trim;
use LWP::RobotUA;
use HTML::TreeBuilder;
use HTML::
img"]/img/@title';
my $XPATH_COVER = '//div[@id="movie-main-image-container"]/a/img/@src';
my @JSON_FIELD = qw(
id title year synopsis website duration cast director composer screenwriter
cinem
rn;
}
=head2 $movie->toJSON()
This method will export all movie informations in JSON format
=cut
sub toJSON {
my $self = shift;
my %data;
foreach my $field (@JSON_FIELD){
$data{$field
vie-info.pl
=head1 DESCRIPTION
Get information from filmaffinity about a film and print them in JSON format
=head1 VERSION
Version 1.01
=head1 USAGE
filmaffinity-get-movie-info.pl --id=123456
--id=123456 --delay=2
filmaffinity-get-movie-info.pl --id=932476 --output=/home/william/matrix.json
=head1 REQUIRED ARGUMENTS
=over 2
=item --id=932476
movie id from filmaffinity
=back
=head1
over 2
=item --delay=3
delay between requests
=item --output=/home/william/matrix.json
output json file
=back
=cut
our $VERSION = '1.01';
Readonly my $DELAY => 5;
my ( $movieID, $delay, $outp
package Bio::Grid::Run::SGE::Index::FileRecordsFromNDJSON;
use warnings;
use strict;
use Mouse;
use IO::Handle;
use Carp;
use List::Util qw/sum/;
use List::MoreUtils qw/uniq/;
use Bio::Gonzales::Ut
s_newer/;
use Bio::Grid::Run::SGE::Util qw/glob_list/;
use Data::Dumper;
use Cwd qw/fastcwd/;
use JSON::XS;
our $VERSION = '0.066'; # VERSION
has 'num_elems_cumulative' => ( is => 'rw' );
has overwr
teable );
my $files_key = $self->files_key;
my $abs_jsonl_files = glob_list($input_files);
my @abs_input_files;
for my $f (@$abs_jsonl_files) {
open my $fh, '<', $f or die "Can't open fi
al reasons, alias *Data::Bool::Impl with JSON::PP::Boolean
*Data::Bool::Impl:: = *JSON::PP::Boolean::;
# JSON/PP/Boolean.pm is redundant
$INC{'JSON/PP/Boolean.pm'} ||= __FILE__
unle
package Bio::Grid::Run::SGE::Index::NDJSON;
use warnings;
use strict;
use Mouse;
use IO::Handle;
use Carp;
use List::Util qw/sum/;
use List::MoreUtils qw/uniq/;
use Bio::Gonzales::Util::File qw/ope
s_newer/;
use Bio::Grid::Run::SGE::Util qw/glob_list/;
use Data::Dumper;
use Cwd qw/fastcwd/;
use JSON::XS;
our $VERSION = '0.066'; # VERSION
has 'num_elems_cumulative' => ( is => 'rw' );
has overwr
$read_length;
return {
file => $idx->[$cur_file_idx]{file},
elements => [ map { decode_json($_) } split(/\n/, $data) ]
};
}
sub num_elem {
my ($self) = @_;
my $num_elems = 0;
#su
ml>
and in Joel Berger's answer here:
L<http://stackoverflow.com/questions/15152633/perl-mojo-and-json-for-simultaneous-requests>.
L<Mojo::UserAgent::Role::Queued> tries to generalize the practice of
erAgent, 1; }
|| die('LWP::UserAgent package not found');
eval { require JSON::XS, 1; }
|| die('JSON::XS package not found');
}
our $VERSION = '0.04';
# singleton and accessor
{
gent->new( keep_alive => 1 );
sub _lwp_agent { return $lwp }
my $json = JSON::XS->new();
sub _json { return $json }
}
sub new {
my ( $class, %options ) = @ARG;
my $object;
$
$options{APIKey} || undef;
$object->{Secret} = $options{Secret} || undef;
$object->{_json} = _json;
$object->{_agent} = _lwp_agent;
return bless $object, $class;
}
sub api_trading {
_->new(@_) }
sub new {
my $class = shift;
return bless {@_}, ref $class || $class;
}
sub TO_JSON { +{%{$_[0]}} }
sub delete {
my $self = shift;
my @values = CORE::delete @$self{@_};
retur
t = Data::Dict->new(a => 1, b => 2);
Construct a new hash-based L<Data::Dict> object.
=head2 TO_JSON
Alias for L</"to_hash">.
=head2 delete
my $deleted = $dict->delete(@keys);
Delete selected
ip2 zip3 ...]
=head1 DESCRIPTION
Retrieves and displays pollen forecast data from Pollen.com for the selected
zip codes.
=head1 REQUIREMENTS
This utility depends on L<JSON::XS> and uses C<curl>.
with the plugin setting C<content_type>.
Here is an example to use JSON:
plugins:
Ajax:
content_type: 'application/json'
=head1 AUTHOR
Dancer Core Developers
=head1 COPYRIGHT AND LICE
(
isa => Enum[qw{application/json application/xml application/yaml application/x-www-form-urlencoded text/javascript}],
is => 'rw',
default => sub { 'application/json' },
);
has 'serializer' => (
> 'ro',
default => \&_set_serializer,
lazy => 1,
);
our %modules = (
'application/json' => {
module => 'JSON',
},
'application/xml' => {
module => 'XML::Simple',
},
'application/yaml' => {
n/x-www-form-urlencoded' => {
module => 'FORM',
},
'text/javascript' => {
module => 'JSON',
},
);
sub _set_serializer {
my $self = shift;
return unless $modules{$self->type};
my $m