'Net::Iugu::Request';
use HTTP::Headers;
use HTTP::Request;
use File::LibMagic;
use JSON qw{ from_json to_json };
use File::Slurp qw{ read_file };
use MIME::Base64 qw{ encode_base64 };
sub create_
>new(
'Authorization' => $auth,
'Content-Type' => 'application/json',
);
my $content = to_json $data;
my $req = HTTP::Request->new(
POST => $uri,
$hea
ders,
$content,
);
my $res = $self->ua->request($req);
return from_json $res->content;
}
sub account_info {
my ( $self, $account_id ) = @_;
my $uri = $self->base_uri .
$VERSION = '0.03';
# -------------------------------------
# Library Modules
use IO::File;
use JSON::XS;
use Labyrinth;
use Labyrinth::Variables;
# -------------------------------------
# The Subs
ributes hash
my $atts = {
pathfile => $pathfile || $settings{pathfile} || './pathfile.json'
};
# create the object
bless $atts, $class;
$atts->load;
return $atts;
};
lf->{pathfile},'r') or return;
local $/ = undef;
my $json = <$fh>;
$fh->close;
eval {
my $data = decode_json($json);
$self->{data} = $data->{paths};
};
return
==================================================
#
# DESCRIPTION: Serialize to mixied XML and JSON
#
# AUTHOR: Aliaksandr P. Zahatski, <zahatski@gmail.com>
#================================
);
=head1 DESCRIPTION
Flow::To::JXML - serialize flow to JSON+XML
=cut
package Flow::To::JXML;
use strict;
use warnings;
use JSON;
use Flow::To::XML;
use base 'Flow::To::XML';
our $VERSION = '
hift;
my $xfl = $self->{_xml_flow};
$xfl->startTag("flow");
$xfl->_get_writer->cdata(JSON->new->utf8->pretty(1)->encode(\@_));
$xfl->endTag("flow");
return $self->Flow::flow(@_)
================================================
#
# DESCRIPTION: Deserialize to mixied XML and JSON
#
# AUTHOR: Aliaksandr P. Zahatski, <zahatski@gmail.com>
#================================
==========================================
=head1 NAME
Flow::From::JXML - deserialize flow from JSON+XML
=head1 SYNOPSIS
my $f2 = create_flow(
FromJXML => \$str2,
Split =>
;
=head1 DESCRIPTION
Flow::To::JXML - serialize flow to JSON+XML
=cut
package Flow::From::JXML;
use strict;
use warnings;
use JSON;
use Flow::To::XML;
use Data::Dumper;
use base 'Flow::From::X
ore::Response;
#$Id$
use Data::Dumper;
use WebDAO::Response;
use JSON;
use WebDAO;
use base qw( WebDAO::Response );
mk_attr ( __json=>undef, __html=>undef, __xml=>undef);
our $VERSION = '0.1';
use
functionality to return context.
=head1 METHODS
=cut
=head2 json
=cut
sub json : lvalue {
my $self = shift;
$self->{__json};
}
sub raw : lvalue {
my $self = shift;
$self->{__r
$res ;
if ( exists $accept->{'application/javascript'} ) {
$res = $self->json;
$res = to_json($res) unless ref($res) eq 'CODE';
} else {
$res = $self->html
}
our $VERSION = '0.02';
$VERSION = eval $VERSION;
use Role::Tiny ();
use Test::Mojo;
use Mojo::JSON 'j';
sub import {
my ($class, @roles) = @_;
@roles = map { s/^\+// ? $_ : "Test::Mojo::Role:
alize your data, without requirement
to do so in XML, you should probably better have a look at L<JSON::XS>
or L<Storable>.
=cut
use warnings;
use strict;
use utf8;
use 5.010;
use feature 'state';
g enough?)
* XSD
* anyone else has an idea?
* what to do with blessed? do the same as JSON::XS does?
=head1 BUGS
Please report any bugs or feature requests to C<bug-data-asxml at rt.cpan
= '0.000002';
use Moo;
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Request;
use JSON qw{ from_json to_json };
use MIME::Base64 qw{ encode_base64 };
use String::CamelCase qw{ decamelize };
has
'Content-Type' => 'application/json',
);
},
);
sub request {
my ( $self, $method, $uri, $data ) = @_;
my $content = $data ? to_json $data : undef;
my $req = HTTP::Re
self->headers,
$content,
);
my $res = $self->ua->request($req);
return from_json $res->content;
}
1;
# ABSTRACT: Net::Iugu::Request - General HTTP requests to Iugu API
__END__
jproperties => {
data_type => "text",
is_nullable => 1,
serializer_class => "JSON"
},
...,
);
with 'DBIx::Class::InflateColumn::Serializer::Role::HashContentAccessor' => {
umn::Serializer|DBIx::Class::InflateColumn::Serializer>
- Inflators for data structures, uses eg. JSON to store the data in the database.
=item *
L<DBIx::Class::InflateColumn::Serializer::Hstore|DBI
package Mojo::JSON::XS;
use strict;
use warnings;
use base 'Mojo::Base';
use JSON::XS;
use Mojo::ByteStream 'b';
# Literal names
our $FALSE = JSON::XS::false;
our $TRUE = JSON::XS::true;
# Byte
[^\0]\0\0\0" => 'UTF-32LE',
"[^\0]\0[^\0]\0" => 'UTF-16LE'
};
__PACKAGE__->attr('_jsonxs' => sub { JSON::XS->new->convert_blessed(1) });
__PACKAGE__->attr('error');
sub decode {
my ($self
_jsonxs->decode($string);};
if ($@) {
$self->_exception($string, $@);
return;
}
return $result;
}
sub encode {
my ($self, $ref) = @_;
my $string = $self->_jsonx
package WebService::JotForm;
use strict;
use warnings FATAL => 'all';
use Moo;
use JSON::MaybeXS;
use LWP::UserAgent;
use URI::Escape qw(uri_escape);
use Carp qw(croak);
=head1 NAME
WebService::Jot
in wrapper around the JotForm API. All results are what's returned by the JotForm API,
with the JSON being converted into Perl data structures.
You need a JotForm API key to use this module. The e
'ro', default => 'v1');
has 'agent' => ( is => 'rw'); # Must act like LWP::UserAgent
my $json = JSON::MaybeXS->new;
sub BUILD {
my ($self) = @_;
if(not $self->agent) {
$self->agent(LWP::U
db;
use strict;
use warnings;
use base 'MojoX::Session::Store';
use Mojo::UserAgent;
use Mojo::JSON;
__PACKAGE__->attr(is_async => 1);
__PACKAGE__->attr(client => sub { Mojo::UserAgent->new; } );
eturn $url;
}
sub _encode_json {
my $self = shift;
my $data = shift;
my $json = Mojo::JSON->new;
$data = $json->encode($data);
unless ($data && !$json->error) {
$self->e
turn $data;
}
sub _decode_json {
my $self = shift;
my $body = shift;
my $json = Mojo::JSON->new;
$body = $json->decode($body);
unless ($body && !$json->error) {
$self->
with 'Articulate::Role::Component';
with 'Articulate::Role::Storage';
use Articulate::Syntax;
use JSON;
use Scalar::Util qw(blessed);
=head1 NAME
Articulate::Content::DBIC::Simple - store your conte
Schema::Result::Articulate::Item>,
and rows contain meta, content and location. Meta is stored in JSON.
It is left up to the application, not the database to maintain
referential integrity (although
lf->construction->construct(
{
location => $dbic_item->location,
meta => from_json( $dbic_item->meta ),
content => $dbic_item->content,
}
);
}
sub real_to_dbic { # in
package Geo::Coder::Bing;
use strict;
use warnings;
use Carp qw(carp croak);
use Encode ();
use JSON;
use LWP::UserAgent;
use URI;
our $VERSION = '0.13';
$VERSION = eval $VERSION;
sub new {
my
es v1 geocodeservice geocodeservice.asmx Geocode
));
$uri->query_form(
format => 'json',
# Note: the quotes around the location parameter are required.
query => qq("$
return unless $res->is_success;
# Change the content type of the response from 'application/json' so
# HTTP::Message will decode the character encoding.
$res->content_type('text/plain');
NAME
Geo::JSON - Perl OO interface for geojson
=head1 VERSION
version 0.005
=head1 SYNOPSIS
use Geo::JSON;
my $obj = Geo::JSON->from_json( $json );
$obj->to_json();
=head1
DESCRIPTION
Convert to and from geojson using Perl objects. GeoJSON objects represent
various geographical positions - points, lines, polygons, etc.
Currently in development - feedback welcome.
Cu
arisons, but will
be read-from and written-to.
=head1 GEOJSON SPECIFICATION
See: L<http://www.geojson.org/geojson-spec.html>
=head1 GEOJSON MEMBERS (ATTRIBUTES)
See the specification for the full
ict;
use warnings;
use parent qw(HTML::Mason::Plugin);
use Time::HiRes qw(time);
use JSON;
my $json = JSON->new->convert_blessed(1)->allow_blessed(1)->allow_unknown(1)->utf8(1);
sub start_com
ame->{end} = time();
$frame->{duration} = $frame->{end} - $frame->{start};
$frame->{args} = $json->encode($context->args);
}
sub end_request_hook {
my ($self, $context) = @_;
$env{main
dleware::Negotiate->new(
formats => {
json => {
type => 'application/json',
app => $json_app,
},
html => {
os_version'=> '800000',
'Accept'=> '*/*',
'platform'=> 'ios',
'Content-Type'=> 'application/json; charset=utf-8',
'Connection'=> 'keep-alive',
'Proxy-Connection'=> 'keep-alive',
'Content-L
>'en' ] );
my @json=split /:/, $ua->request($request)->as_string();
for(my $i=0;$i< scalar(@json);$i++)
{
if ($json[$i] =~ /token/)
{
$self->{_TinderToken}=$1 if $json[$i+1] =~ /"(.+?
os_version'=> '800000',
'Accept'=> '*/*',
'platform'=> 'ios',
'Content-Type'=> 'application/json; charset=utf-8',
'Connection'=> 'keep-alive',
'Proxy-Connection'=> 'keep-alive',
'Content-L
lication/json'], # exported/imported by Settings::Filebrowser, is application/json
wfl => ['Wrangler Field Layout', 'application/json'], # exported/imported by FormEditor, is application/json
wma =>
0 2013-07-01 (unreleased)
- start of new major version, branch/rewrite
- switch from YAML to JSON for settings
- new XDG config file location
- removed sidecar-file handling for now
- many