o", "$mappath.meta"
or die "$mappath.meta: $!\n";
print $fh DC::encode_json $meta;
close $fh;
open my $fh, ">:raw:perlio:utf8", $mappath
troy {
my ($self) = @_;
$self->hide;
$self->emit ("destroy");
%$self = ();
}
sub TO_JSON {
{ "\fw" => $_[0]{s_id} }
}
sub show {
my ($self) = @_;
return if $self->{parent};
se Bot::BasicBot::Pluggable::Module::Notes::Store::SQLite;
use File::Spec::Functions;
use JSON ();
my $store = Bot::BasicBot::Pluggable::Module::Notes::Store::SQLite
->new( "/home/ca
;
return [ 200, [ 'Content-type' => $type ], [ $file_content ] ];
}
sub notes_json {
my ($self, %params) = @_;
# my @checkedparams{ qw(date time channel name notes)
$rows,
};
return [ 200, [ 'Content-type' => 'application/json' ], [ JSON::encode_json($notes) ] ];
}
dispatch {
sub (/) {
return $self->static
;
use Pod::POM ();
use File::Path ();
use Storable (); # finally
use Fcntl ();
use JSON::XS qw(encode_json decode_json);
use Guard qw(guard);
=item shorten $string[, $maxlength]
=cut
sub shorten($;
line =~ s/\s+$//;
utf8::decode $line;
if ($line =~ /^\x{e877}json_msg (.*)$/s) {
$cb->(JSON::XS->new->allow_nonref->decode ($1));
} else {
::message
);
}
}
});
}
sub background_msg {
my ($msg) = @_;
$msg = "\x{e877}json_msg " . JSON::XS->new->allow_nonref->encode ($msg);
$msg =~ s/\n//g;
utf8::encode $msg;
print
mand => "*";
$self->{json_coder}
->convert_blessed
->filter_json_single_key_object ("\fw" => sub {
$self->{widget}{$_[0]}
})
->filter_json_single_key_object ("\fc"
_face_handler ($exp_table, sub {
my ($face) = @_;
$self->{exp_table} = $self->{json_coder}->decode (delete $face->{data});
$_->() for values %{ $self->{on_exp_update} || {}
my ($face) = @_;
undef $handler;
$done_cb->();
$parse_list->($self->{json_coder}->decode ($face->{data}));
});
} else {
$done_cb->(0);
}
}
# widgetset a
s/jquery.js
# to get the /path/to/htdocs/js/jquery.js
# $ GET http//localhost/js/dynamic-json.js
# to get the your application response
Will you want to set config from yaml?
my $mw
s/jquery.js
# to get the /path/to/htdocs/js/jquery.js
# $ GET http//localhost/js/dynamic-json.js
# to get the your application response
Do you want 404 handle has backend application?
s = @_;
if (ref($args{'action_links'}) eq 'ARRAY') {
eval q{use JSON::Any};
croak "Unable to load JSON module to encode 'action_links':$@\n" if $@;
$args{'action_links'} =
k API.
$client->stream->publish(
message => $message,
attachment => $json,
action_links => [@links],
);
=item remove( %params )
The stream.remove method of t
e MooseX::AttributeHelpers;
use MooseX::Iterator;
use MooseX::Storage;
with Storage('format' => 'JSON', 'io' => 'File');
has 'events' => (
metaclass => 'Collection::Array',
is => 'rw',
i
ooseX::AttributeHelpers;
use DateTime;
use DateTime::Format::ISO8601;
with Storage('format' => 'JSON', 'io' => 'File');
has 'id' => ( is => 'rw', isa => 'Int' );
has 'action' => ( is => 'rw', isa
package Osgood::Client;
use Moose;
use HTTP::Request;
use JSON::XS;
use LWP::UserAgent;
use Moose::Util::TypeConstraints;
use Osgood::EventList;
use Osgood::Event;
use URI;
subtype 'Osgood.Client.UR
$req->content_type('application/json');
$req->content($self->list->freeze);
my $res = $ua->request($req);
if($res->is_success) {
my $data = JSON::XS->new->decode($res->content);
if(!defined($data) || !(ref($data) eq 'HASH')) {
$self->error('Unable to parse JSON response');
return 0;
}
my $count = $data->{count};
if($data-
N::Testers::Common::Utils 0.001
=head2 Support Modules
Optional but improve performance
=head3 JSON::XS 2.00
=head1 PENDING INCLUSION:
Metabase::Web 0.003 # not yet on CPAN
=head1 AUTHOR
Da
$id )
The fbml.getCustomTags method of the Facebook API.
=item register_custom_tags( tags => [@json_tags] )
The fbml.registerCustomTags method of the Facebook API.
=item set_ref_handle( handle =
is the only
parameter required.
$client->fbml->upload_native_strings(
native_strings => 'JSON'
);
The format for C<native_strings> is described on the developers wiki:
http://wiki.developer
cut
use Carp;
use LWP::UserAgent;
use JSON;
my $KEEP_ALIVE_CACHESIZE = 10;
my $API_VERSION = '1.2.1';
my $ENDPOINT_BASE = 'api.smugmug.com/services/api/json/1.2.1/';
my $ERROR_CODE = {
MISSING_
>agent($agent);
$ua->timeout(30);
$ua->env_proxy;
my $json = JSON->new();
my $self = bless {
ua => $ua,
json => $json,
retry => $retry,
agent => $agent,
sm_
=> $params->{SessionID},
'X-Smug-Version' => $API_VERSION,
'X-Smug-ResponseType' => 'JSON',
'X-Smug-FileName' => $params->{FileName},
);
my @optional_params =
qw/AlbumID Image
nt->feed->publish_user_action(
template_bundle_id => 'id',
template_data => 'JSON',
body_general => 'markup',
target_ids => [@array_of_ids],
);
template_bundle(
one_line_story_templates => 'JSON',
short_story_templates => 'JSON',
full_story_template => 'JSON',
);
The formats for C<one_line_story_templates>
e => 'markup',
title_data => 'JSON',
body_template => 'markup',
body_general => 'markup',
body_data => 'JSON',
image_1 => 'image url',
acebook API:
$response = $client->connect->get_unconnected_friends_count(
format => $json,
);
=item register_users( %params )
The connect.registerUsers method of the Facebook API:
$json,
data => $RAW_DATA,
);
=item edit( %params )
The events.edit method of the Facebook API:
$response = $client->events->edit(
eid => $eid,
event_info => $json,
my ( $format, $parse ) = ( $self->base->format, $self->base->parse );
$self->base->format('JSON');
$self->base->parse(0);
$token = $self->base->call( 'auth.createToken', @_ );
$tok
my ( $format, $parse ) = ( $self->base->format, $self->base->parse );
$self->base->format('JSON');
$self->base->parse(1);
my $resp = $self->base->call( 'auth.getSession', auth_token =>
lient->profile->set_info(
title => 'title',
type => '1|5',
info_fields => 'JSON',
uid => 'user_id',
);
The format for C<info_fields> is described on the developer wik
ns(
field => 'field_title',
options => 'JSON',
);
The format for C<options> is described on the developer wiki:
http://wiki.developers.fa
the Facebook API.
$result = $client->Admin->set_app_properties(
properties => encode_json {
application_name => 'testapp',
callback_url => 'http://example.com/testapp/'
method of the Facebook API.
$result = $client->Admin->set_restriction_info(
encode_json { age => '21+', location => 'us' }
);
=item ban_users( %params )
The Admin.banUsers method
name: $@\n" if not $namespace;
}
our %attributes = (
parse => 1,
format => 'JSON',
debug => 0,
throw_errors => 1,
api_version => '1.0',
apps_uri => 'h
arams .= "&$_=$params{$_}";
}
}
return $params;
}
sub _parser {
my $parser = JSON::Any->new;
$parser->handler->allow_nonref;
return $parser;
}
sub _parse {
my ( $sel
# Only load JSON::Any if we haven't already. Lets the developers
# pick their choice of JSON modules (JSON::DWIW, for example)
## no critic
eval q{use JSON::Any};