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)
;
use warnings;
use utf8;
use constant API_ENDPOINT => 'http://express.heartrails.com/api/json?';
use JSON;
use Encode;
use URI;
sub call{
my($class,$sub_url) = @_;
my $uri = URI->new(API_ENDPO
m C<storage_class>
File format used to store session data. Defaults to the config class
value; C<JSON>
=back
=head1 Subroutines/Methods
None
=head1 Diagnostics
None
=head1 Dependencies
=over 3
# ignore scripts
\.(gif|png|jpg) | # ... images
\.(readme|meta|yml|json|changelog) | # ... package files
\.(asc|pdf|ppm|patch|pod|txt) $ # ... docs and pa
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
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
ea => $area,prefecture => $prefecture};
}
};
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
return JSON::decode_json($content)->{response}->{line};
}
1;
'getStations',x => $x,y => $y};
}
};
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
return JSON::decode_json($content)->{response}->{station};
}
1;
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
ne => $line ,name => $name};
}
};
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
return JSON::decode_json($content)->{response}->{station};
}
1;
ckage WWW::Jugem::API;
use 5.008005;
use strict;
use warnings;
use utf8;
use Mouse;
use Furl;
use JSON;
our $VERSION = "0.01";
use constant BASE_URL => 'http://api.jugemkey.jp/api/horoscope/free/';
lf->date;
my $url = BASE_URL.$date;
my $response = $self->furl->get($url);
my $content = JSON::decode_json($response->content);
return $content->{horoscope}->{$date}->[$star_chart{$star}];
}
1;
es, URLs or streams to operate on.
FileSpecs have a two part syntax. They start with an optional JSON-like
options specification, and are followed by a (non-optional) file name, URL or
dash. Some exa
tp://www.example.com/data.rdf
{format:"Turtle",base:"http://www.example.net/"}-
The optional JSON-like part is a list of key-value pairs, where pairs are
separated with commas, and keys are seper
t, $args) = @_;
if (@$args)
{
require App::perlrdf::FileSpec;
say
App::perlrdf::FileSpec->new_from_filespec($_)->TO_JSON(1),
for @$args;
}
else
{
say $class->description;
}
}
1;
d1 Configuration and Environment
Reads configuration from F<~/.yakuakue_sessions/yakuake_session.json> which
might look like;
{
"doc_title": "Perl",
"tab_title": "Oo.!.oO"
}
See t
m C<storage_class>
File format used to store session data. Defaults to the config class
value; C<JSON>
=back
Modifies these methods in the base class
=over 3
=item C<run>
=back
=head1 Subroutin
strict;
use warnings;
our $VERSION = 0.14;
use base qw(CohortExplorer::Datasource);
use JSON qw( decode_json );
#-------
sub authenticate {
my ( $self, %opts ) = @_;
my $ds_name = $self->name;
r
Accept => "application/json"
);
my $res = $ua->request($req);
my $code = $res->code;
if ( $code == 200 ) {
my $json = decode_json( $res->decoded_content );
if ( $json->{type} ne 'mongodb' )
w = map { $_ => 1 } @{ $json->{view} || [] };
my @tables = @{ $json->{table} || [] };
# Get all base tables ( i.e. exclude views )
my @base_tables =
defined $json->{view} ? grep { not $
utput eq 'json' ) {
eval {
require JSON;
JSON->import;
print encode_json( \@found );
} or do {
die "You require the module JSON for this
$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),
$VERSION = '0.12'; # VERSION: generated by DZP::OurPkgVersion
use Log::Any qw{$log};
require JSON::MaybeXS;
use Data::UUID ();
use Hash::Util 0.06 qw{lock_keys lock_keys_plus unlock_keys legal_ke
->fatalf("Missing config item \'project_id\'. Please check that Iron.io config is accessible (by .json file or environmental variables).");
$log->tracef('Exiting check_for_iron_io_config():%d'
arnings;
use LWP::UserAgent;
use HTTP::Response;
use HTTP::Request::Common;
use MIME::Base64;
use JSON;
use Data::Dumper;
sub new {
my $class = shift;
my $self = {};
bless ($self,$class);
s = $self->_do_request(GET $url);
my $content = $res->content;
my $values = JSON::decode_json($content);
@entries = @$values;
};
my @ret = ();
foreach my $entry (@e
s to try to JSON decode it. If that works,
#return the JSON decoded value. Otherwise, return it un-decoded
my $value;
eval {
$value = JSON::decode_json($entry->{V
;
if ( $param->{'json'} and psmisc::use_try 'JSON' ) {
$config{'view'} = 'json';
my $j = {};
eval { $j = JSON->new->decode( $param->{'json'} ) || {} }; #allow_
r\n>" ); }
exit;
};
$config{'out'}{'json'}{'http-header'} = "Content-type: application/json\n\n";
$config{'out'}{'json'}{'footer'} ||= sub {
my ( $param, ) = @_;
$param->{'callback'} . '(':'') ,${ psmisc::json_encode($param->{__result} || {}) }, ($param->{'callback'} ? ');' : '');
};
$config{'out'}{'json'}{'result_string'} ||= sub {
my ( $
che cache_A01 --alternatives
ironcache.pl list items .+ --cache cache_A01 --config iron_cache.json
ironcache.pl list items item.01_0[[:digit:]]{1} --cache cache_B05
ironcache.pl list items