ver, you may be interested in his alternative
query distribution L<CPAN::Testers::Reports::Query::JSON>.
Initially released during the 2012 QA Hackathon in Paris.
=head1 CPAN TESTERS FUND
CPAN Test
at});
croak "Unknown data format specified\n" unless($hash{format} =~ /^(yaml|json)$/i);
croak "Must specify a file or data block to parse\n" unless($hash{data} || $hash{fil
:Parser;
my $obj = CPAN::Testers::WWW::Reports::Parser->new(
format => 'YAML', # or 'JSON'
file => $file # or data => $data
);
# iterator, filtering field names
$obj-
hashref
my $obj = CPAN::Testers::WWW::Reports::Parser->new(
format => 'YAML', # or 'JSON'
file => $file # or data => $data
objects => 1, # Optional, works w
irebase::Auth::VERSION = '1.0002';
use strict;
use warnings;
use Digest::SHA qw(hmac_sha256);
use JSON::XS;
use POSIX;
use MIME::Base64;
use Moo;
use Ouch;
has token_version => (
is => 'rw'
) = @_;
my $ejsn = JSON::XS->new->utf8->space_after->encode ({'typ'=> 'JWT', 'alg'=> 'HS256'}) ;
my $encoded_header = $self->urlbase64_encode( $ejsn);
my $eclm = JSON::XS->new->utf8->space
Firebase::Auth;
use HTTP::Thin;
use HTTP::Request::Common qw(DELETE PUT GET POST);
use Ouch;
use JSON;
use URI;
has firebase => (
is => 'ro',
required => 1,
);
has auth => (
te_uri($path);
my $request = POST($uri->as_string, Content_Type => 'form-data', Content => to_json($params));
$request->method('PUT'); # because HTTP::Request::Common treats PUT as GET rather
te_uri($path);
my $request = POST($uri->as_string, Content_Type => 'form-data', Content => to_json($params));
$request->method('PATCH'); # because HTTP::Request::Common treats PUT as GET rathe
:Parser;
my $obj = CPAN::Testers::WWW::Reports::Parser->new(
format => 'YAML', # or 'JSON'
file => $file # or data => $data
objects => 1, # Optional, works wit
ion();
}
=head1 DESCRIPTION
This distribution is used to extract the data from either a JSON or a YAML file
containing metadata regarding reports submitted by CPAN Testers, and available
fr
ref to tie hash to" unless ref $ref eq 'SCALAR';
$implementation = "Scalar::Accessors::LikeHash::JSON" unless defined $implementation;
Module::Runtime::use_package_optimistically($implementation);
LikeHash> role. If the implementation is omitted, then
defaults to L<Scalar::Accessors::LikeHash::JSON>.
=head1 BUGS
Please report any bugs to
L<http://rt.cpan.org/Dist/Display.html?Queue=Scalar-Acc
t AREA_ENDPOINT => 'http://express.heartrails.com/api/json?method=getAreas';
use constant PREF_ENDPOINT => 'http://express.heartrails.com/api/json?method=getPrefectures';
sub _build_areas{
my $self
= JSON::decode_json($response->{content});
return $content->{response}->{area};
}
sub _build_prefs{
my $self = shift;
my $response = $self->provider->furl->get(PREF_ENDPOINT);
my $content = JSON:
:decode_json($response->{content});
return $content->{response}->{prefecture};
}
no Mouse;
__PACKAGE__->meta->make_immutable;
1;
__END__
=encoding utf-8
=head1 NAME
WebService::Heartrails::Expr
$invocant->_empty_structure;
}
1;
__END__
=head1 NAME
Scalar::Accessors::LikeHash - access a JSON/Sereal/etc scalar string in a hash-like manner
=head1 SYNOPSIS
{
package Acme::Storabl
sors::LikeHash::JSON";
$string->store(foo => 42);
Or as class methods passing the scalar reference as an extra first argument:
my $string = "{}";
Scalar::Accessors::LikeHash::JSON->store(\$string
tations, see L<Scalar::Accessors::LikeHash::JSON>
and L<Scalar::Accessors::LikeHash::Sereal>.
For an insane usage of this concept, see L<Acme::MooseX::JSON>.
=head1 AUTHOR
Toby Inkster E<lt>tobyink
t => 0.3;
has 'storage_class' => is => 'lazy', isa => NonEmptySimpleStr,
default => 'JSON';
has 'tab_title' => is => 'lazy', isa => NonEmptySimpleStr,
default => 'Shell';
ime>
Time in seconds to sleep whilst C<DBus> settles down
=item C<storage_class>
Defaults to C<JSON>. Format of the configuration file
=item C<tab_title>
Defaults to C<Shell>. String used for the
utput eq 'json' ) {
eval {
require JSON;
JSON->import;
print encode_json( \@found );
} or do {
die "You require the module JSON for this
query_parse );
use constant description => <<'DESCRIPTION';
Output formats are: SSE (default), JSON, YAML, SPARQL.
DESCRIPTION
use constant opt_spec => (
[ 'execute|e=s', 'Query to parse' ]
' options.")
if exists $opt->{sparql_file} && exists $opt->{execute};
}
sub execute
{
require JSON;
require YAML::XS;
require RDF::Query;
my ($self, $opt, $arg) = @_;
my $sparql = $self->_
putFile',
);
foreach my $out (@outputs)
{
my $str;
if ($out->format =~ /json/i)
{ $str = JSON::to_json( $query->as_hash, {pretty=>1,canonical=>1} ) }
elsif ($out->format =~ /ya?ml/i)
ge_format => 'text',
notify => 1,
color => 'yellow',
format => 'json',
});
unless ($response->is_success) {
warn "Hipchat notification failed!";
warn $resp
$App::perlrdf::FileSpec::VERSION = '0.006';
}
use Moose;
use Moose::Util::TypeConstraints;
use JSON;
use PerlX::Maybe;
use RDF::Trine;
use URI;
use URI::file;
use namespace::clean;
class_type Path
=> 1,
);
sub DEFAULT_STREAM
{
warn "DEFAULT_STREAM is 'stdout:'\n";
return "stdout:";
}
sub _jsonish
{
my ($self, $str) = @_;
$str =~ s/(^\{)|(\}$)//g; # strip curlies
my $opts = {};
while
$name) = ($spec =~ m<^ (\{ .*? \}) (.+) $>x)
? ($1, $2)
: ('{}', $spec);
my $opts = $class->_jsonish($optstr);
$class->new(
'uri' => ($name eq '-' ? $class->DEFAULT_STREAM : $name),
return "Syntax::Highlight::XML"->new;
};
$hint =~ m{json}i and do {
require Syntax::Highlight::JSON2;
return "Syntax::Highlight::JSON2"->new;
};
$hint =~ m{(ttl|turtle)}i and retur
s yet)
=item *
SPARQL Update 1.1 (but not property paths yet)
=item *
JSON - intended for RDF/JSON and SPARQL Results JSON, but just generic highlighting
=item *
XML - intended for RDF/XML and S
rt.cpan.org/Dist/Display.html?Queue=Syntax-Highlight-RDF>.
=head1 SEE ALSO
L<Syntax::Highlight::JSON2>,
L<Syntax::Highlight::XML>.
L<PPI::HTML>,
L<Syntax::Highlight::Engine::Kate>.
L<RDF::Trine>,
c::OutputBindings::VERSION = '0.004';
}
use Any::Moose;
use File::Temp qw(tempfile);
use JSON qw(from_json);
use RDF::Trine;
use Spreadsheet::Wright;
use YAML::XS qw(Dump);
use namespace::clean;
if $self->uri =~ /\.ya?ml/i;
return 'XML' if $self->uri =~ /\.xml/i;
return 'JSON' if $self->uri =~ /\.json/i;
return 'CSV' if $self->uri =~ /\.csv/i;
return 'XLS' if $self->uri =~
@_;
if ($self->format =~ /json/i)
{
$self->handle->print($iter->as_json);
}
elsif ($self->format =~ /yaml/i)
{
$self->handle->print(Dump from_json($iter->as_json));
}
elsif ($self->format
js/locale_simple.js"></script>
<script language="javascript" src="locale/de_DE/LC_MESSAGES/test.json"></script>
ltd('test');
l("Hello");
ln("You have %d message","You have %d messages",4);
hich is wrapped, requires a json file to be
generated out of the po. This can be achieved with po2json which is delivered with
this package. Sadly it only generates the json and doesnt integrate it in
echo -n "locale_data['test'] = " >data/locale/test.json
po2json data/locale/test.po >>data/locale/test.json
echo ";" >>data/locale/test.json
B<WARNING> it could be that the way how to integrat
my $accept = join q{, } => (
'application/sparql-results+xml',
'application/sparql-results+json;q=0.9',
'application/rdf+xml',
'application/x-turtle',
'text/turtle',
);
my $agent =
ocal $@ = undef;
my $iterator = eval
{
if ($response->content_type =~ /json/)
{ RDF::Trine::Iterator->from_json($response->decoded_content); }
else
{ RDF::Trine::Iterator->from_strin
# ignore scripts
\.(gif|png|jpg) | # ... images
\.(readme|meta|yml|json|changelog) | # ... package files
\.(asc|pdf|ppm|patch|pod|txt) $ # ... docs and pa
package Number::Natural::SetTheory;
use 5.010;
use boolean;
use JSON qw/to_json/;
use strict;
use utf8;
our (@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
BEGIN
{
$Number::Natural::SetTheory::AUTHORITY = 'c
return scalar @$set;
}
return undef;
}
sub set_to_string
{
my ($set) = @_;
my $string = to_json($set);
$string =~ s/\[/\{/g;
$string =~ s/\]/\}/g;
return $string;
}
'What exactly is zero?';
=head1 NAME
JSON::Schema::Examples - examples of JSON::Schema
=head1 EXAMPLES
=head2 Validate some JSON contact info against nested schemas.
The card schema at L<http://json-schema.org/card> is tr
eed to be followed. But JSON::Schema
handles it with ease...
use JSON qw[to_json];
use JSON::Schema;
use LWP::Simple qw[get];
# Here's some data...
my $contact = to_json({
fn => 'Tob
n => 'East Sussex' },
});
# Now we create our JSON Schema validator:
my $card_schema = get('http://json-schema.org/card');
my $validator = JSON::Schema->new($card_schema);
# Validate:
my $v