$data{$c} = $self->get_attr_multilang($c, $language);
}
return %data;
}
sub get_json_data
{
my $self = shift;
my $language = shift;
my %data = $self->get_ext_data($langua
my $img = $self->new($_->id);
my %el;
if(exists $args{'json'})
{
%el = $img->get_json_data($args{'language'});
}
else
{
if(e
package WWW::Jirafe;
use strict;
use 5.008_005;
our $VERSION = '0.01';
use LWP::UserAgent;
use JSON;
use Carp 'croak';
use URI::Escape qw/uri_escape/;
use HTTP::Request;
sub new {
my $class = s
n} or croak "access_token is required.";
$args{ua} ||= LWP::UserAgent->new();
$args{json} ||= JSON->new->allow_nonref->utf8;
$args{API_BASE} ||= 'https://event.jirafe.com/v2/';
bles
lf->{access_token});
$req->header('Accept', 'application/json'); # JSON is better
if ($params) {
$req->content($self->{json}->encode($params));
}
my $res = $self->{ua}->request
dd to Calendar"
onclick="location = getCalendar(this)"></p>
...
<meta itemprop="description" content="via livebrum.co.uk">
</body>
EOF
use Data::Dumper;
warn Dumper $microdata->as_json;
warnings;
use lib lib => glob 'modules/*/lib';
use LWP::Simple qw($ua);
use HTML::Microdata;
use JSON;
my $uri = shift;
my $res = $ua->get($uri);
unless ($res->is_success) {
warn $res->status_line
;
exit 1;
}
my $microdata = HTML::Microdata->extract($res->decoded_content, base => $uri);
print JSON->new->pretty->encode($microdata->items);
PI;
$Strehler::API::VERSION = '1.6.8';
use strict;
use Dancer2 0.166001;
use Dancer2::Serializer::JSON;
use Strehler::Helpers;
use Strehler::Meta::Category;
prefix '/api/v1';
set layout => undef;
m
my %data = $obj->get_json_data($lang);
if($callback)
{
content_type('application/javascript');
}
else
{
content_type('application/json');
}
return se
content_type('application/javascript');
}
else
{
content_type('application/json');
}
return serialize(\%data, $callback);
};
get '/:entity/:id' => sub {
my $entity
Dancer2 0.166001;
use Dancer2::Plugin::DBIC;
use Dancer2::Plugin::Ajax;
use Dancer2::Serializer::JSON;
use Strehler::Dancer2::Plugin::Admin;
use HTML::FormFu 1.00;
use HTML::FormFu::Element::Block;
u
lse
{
return 0;
}
};
ajax '/category/info' => sub
{
content_type('application/json');
my $category;
my $input = params->{input};
my $option = params->{option} || undef;
me'} . "/*";
$data{'id'} = 'anc:'.$input;
}
my $serializer = Dancer2::Serializer::JSON->new();
return $serializer->serialize(\%data);
};
ajax '/category/tagform/:type/:id?' => sub
inaWeibo::LAST_DISPATCH_TIME = undef;
use Mojo::Base 'Mojo::EventEmitter';
use Mojo::JSON qw(encode_json decode_json);
use Mojo::Util qw(b64_encode dumper sha1_sum url_escape url_unescape encode decod
62'
),
);
};
has 'nick';
has login_type => "rsa";#wsse
has api_form => "HTML";#HTML|JSON
has login_state => "invalid";
has 'need_pin' => 0;
has rsa => sub {Crypt::RSA::ES::PKCS1v15->new}
&callback=parent.sinaSSOController.feedBackUrlCallBack',
returntype => ($s->api_form eq "JSON"?"TEXT":"META"),
servertime => $s->servertime,
nonce => $s->nonce,
p;
use JSON ();
sub now{
my $self = shift;
return int Time::HiRes::time() * 1000;
}
sub json_decode {
my $self = shift;
my $json = shift;
my $d;
eval{
$d = JSON->new->
>decode($json);
};
return $d;
}
sub json_encode {
my $self = shift;
my $d = shift;
my $json;
eval{
$json = JSON->new->utf8->encode($d);
};
return $json;
}
su
sub _parse_send_status_data {
my $self = shift;
my $json = shift;
if(defined $json){
my $d = $self->json_decode($json);
return {is_success => 0,status=>"数据格式错
eue} = $self->_queue->copy if $self->_queue;
$self->new(%params);
}
{ no warnings 'once'; *TO_JSON = *export }
sub export {
my ($self) = @_;
+{
events => $self->events,
seconds =>
meant like a government thing\n]
unless caller; 1;
=pod
=for Pod::Coverage EVENTS QUEUE SECS TO_JSON
=head1 NAME
Object::RateLimiter - A flood control (rate limiter) object
=head1 SYNOPSIS
use
my $ua = LWP::UserAgent->new();
my $url = 'https://api.hipchat.com/v1/rooms/message?format=json&auth_token='.$self->config->{hipchat_token};
foreach my $to (@tos){
$ua->post($url, {
json = $self->http_post(Weixin::Util::gen_url($api,@query_string),@headers,("Content-Type"=>"application/json; charset=UTF-8"),Content=>$self->json_encode($post));
my $d = $self->json_decode($json
*/*
>
< HTTP/1.1 200 OK
< Server: Mojolicious (Perl)
< Content-Type: application/json;charset=UTF-8
< Connection: keep-alive
< Date: Fri, 12 Jun 2015 08:01:08 GMT
< Conten
录加密算法,当前仅支持rsa登录加密算法,wsse无法正常登录
api_form #JSON|HTML 微博api接口返回类型,当前仅能够在HTML模式下正常工作
=head1 客户端方
nt;
use strict;
use Config::IniFiles;
use File::HomeDir;
use File::Spec;
use HTTP::Request;
use JSON;
use LWP::UserAgent;
use Sys::Hostname;
our $VERSION = 0.07;
use constant {
SUCCESS =
include
an "inhibit" hash key.
=cut
sub start {
my $self = shift;
return $self->_write_json($self->_get_url('start'), {
command => $self->{'command'}}, 1);
}
=item finish()
Report
on success.
=cut
sub finish {
my $self = shift;
my %opt = @_;
return $self->_write_json($self->_get_url('finish'), {
command => $self->{'command'},
status => defined $o
rict;
use warnings;
use parent qw/Class::Accessor::Fast/;
our $VERSION = 0.006;
use JSON::MaybeXS qw/decode_json/;
use MIME::Base64;
use URI::Escape;
use WebService::Strike;
__PACKAGE__->mk_ro_acce
or single method given";
}
}
# Payload (3) Headers Attributes Body Body_CODE Body_YAML Body_JSON Schema Concat
BEGIN { push @EXPORT_OK => qw(Payload) }
sub Payload {
my $args = shift;
m
Body_YAML( delete $args->{yaml} );
}
elsif ( exists $args->{json} ) {
push @body => Body_JSON( delete $args->{json} );
}
push @body => Schema( delete $args->{schema} ) if exi
' ) );
}
sub _json {
my ($struct) = @_;
load_class('JSON');
our $JSON //= JSON->new->utf8->pretty->allow_nonref->convert_blessed;
$JSON->encode($struct);
}
# Body_JSON (2) Body_CODE
'bar' # config files prefix
extensions => [ # file extensions to search
qw(json yml perl)
]
}
);
# Mojolicious::Lite
plugin 'ConfigAny';
=head1 DESCRIPTION
L<
warnings;
use HTML::TreeBuilder::LibXML;
use Hash::MultiValue;
use Scalar::Util qw(refaddr);
use JSON;
use URI;
our $VERSION = '0.05';
sub new {
my ($class, %args) = @_;
bless {
items => [],
= @_;
my $self = $class->new(%opts);
$self->_parse($content);
$self
}
sub as_json {
my ($self) = @_;
encode_json +{
items => $self->{items},
};
}
sub items {
my ($self) = @_;
$self->{item
my $json = $microdata->as_json;
use Data::Dumper;
warn Dumper $microdata->items; # returns top level items
=head1 DESCRIPTION
HTML::Microdata is extractor of microdata from HTML to JSON etc.
e 5.008001;
use strict;
use warnings;
our $VERSION = "0.01";
use JSON::PP;
use DBI qw/:sql_types/;
use File::Spec;
my $_JSON = JSON::PP->new;
my %_NAMEMAP = map { $_ => *{$DBI::{$_}}{CODE}->() } @{
= File::Spec->catfile($outdir, "$table->{name}.json");
open my $fh, '>', $file or die "$file: $!"; # uncoverable branch
print {$fh} $_JSON->encode($table->{schema});
close $fh;
This module will produce text output of the schema suitable for Google BigQuery.
It will be a '.json' file of BigQuery schema format.
=head1 ARGUMENTS
=over 4
=item C<outdir>
Base directory of o
*/*
>
< HTTP/1.1 200 OK
< Server: Mojolicious (Perl)
< Content-Type: application/json;charset=UTF-8
< Connection: keep-alive
< Date: Fri, 12 Jun 2015 08:01:08 GMT
< Conten
录加密算法,当前仅支持rsa登录加密算法,wsse无法正常登录
api_form #JSON|HTML 微博api接口返回类型,当前仅能够在HTML模式下正常工作
=head1 客户端方