een written to in the $interval (by default last day).
use 5.14.1;
use Graphite::Enumerator;
use JSON;
use Getopt::Long;
my $interval = '1day';
my $basepath = '';
GetOptions(
"interval=s" => \$i
t=json&from=-$interval&target=summarize($path,%22$interval%22,%22max%22,true)";
my $res = $gren->ua->get($last_hour_data_url);
if ($res->is_success) {
my $last_hour_data = decode_json(
package Graphite::Enumerator;
use 5.14.1;
use Carp qw/croak/;
use LWP::UserAgent;
use JSON;
use Scalar::Util 'reftype';
our $VERSION = '0.03';
# Recognized constructor options:
# - host (base URL)
my $completer_answer = eval { decode_json($res->content) };
if (!$completer_answer) {
$self->log_warning("URL <$url>: Couldn't decode JSON string: <" . $res->content . ">: $@");
se64;
use File::Path qw/make_path/;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
use JSON::MaybeXS;
use YAML;
use URI::Encode qw/uri_encode/;
use Encode;
our $VERSION = 0.023;
=head1 NA
h = HTTP::Headers->new();
$h->header( 'Content-Type' => "application/json" );
$h->header( 'Accept' => "application/json" );
$h->header( 'Authorization' => "Basic " . $self->_zendesk_creden
e => { isa => 'Int', optional => 1 },
);
my $path = '/incremental/ticket_events.json';
my @results = $self->_paged_get_request_from_api(
field => '???', # <--- TODO
my $response_json = $storage->retrieve($progress_id)
or return $self->render(status => 404, json => {});
return $self->render(json => { progress => $response_json });
}
=h
progress report. The request contains the progress id, and
it's simply fetched and returned as a JSON payload.
See above for the contents of the payload.
=head3 Client making a request to a long r
Request::VERSION"); },);
has api_key => ( is => 'rw');
has output => ( is => 'rw', default => 'json');
has debug => ( is => 'rw', default => 0);
sub _get {
my ($self, $path) = @_;
my @
y $url = $cident->claimed_url;
my $openid_server = $cident->identity_server;
# ... return JSON with those to user agent (whose request was
# XMLHttpRequest, probably)
}
if ($CLASSIC_m
on are
documented by Mr. Ruzmetov in the perldoc for his module.
If you need some combination of json, yaml, xml, perl, ini or
Config::General formats, take a look at: Config::Merge, which I
learned
ed_selects{$or_self} = {};
# deep copy hash
require JSON::XS;
$hr_search = JSON::XS::decode_json(
JSON::XS::encode_json( $hr_search )
);
my (
$s_limit,
$s
rts in serialized JSON, to emulate storing them in an
external server, which is better than just keeping the hashref around
would be.
=cut
use JSON::Tiny qw/ encode_json decode_json /;
=head1 PRO
tore {
my $self = shift;
my ($id, $content) = @_;
$self->id__report->{ $id } = encode_json( $content );
}
=head2 retrieve($id) : $content | undef
Retrieve the current report $content und
or undef if
none was found.
=cut
sub retrieve {
my $self = shift;
my ($id) = @_;
my $report_json = $self->id__report->{ $id } // return undef;
return decode_json( $report_json );
}
arch ) = @_;
my $s_key;
if ( $or_self->{cache} ) {
require JSON::XS;
$s_key = JSON::XS::encode_json($hr_search);
if ( my $ar_search_data = $or_self->{cache}->get("sear
arch ) = @_;
my $s_key;
if ( $or_self->{cache} ) {
require JSON::XS;
$s_key = JSON::XS::encode_json($hr_search);
if ( my $hr_search_data = $or_self->{cache}->get( "sea
(hmac_sha1_hex);
use Time::Local;
use HTTP::Request;
use LWP::UserAgent;
use Storable;
use JSON qw(encode_json);
use URI::Escape qw(uri_escape_utf8);
use HTML::Parser;
sub new {
my Net::OpenID::C
fail($code) $text");
}
wantarray ? () : undef;
}
sub json_err {
my Net::OpenID::Consumer $self = shift;
return encode_json({
err_code => $self->{last_errcode},
err_tex
elow.
=item $csr->B<errtext>
Returns the last error text.
=item $csr->B<json_err>
Returns the last error code/text in JSON format.
=back
=head2 Configuration
=over 4
=item $csr->B<ua>($user_ag
ed_selects{$or_self} = {};
# deep copy hash
require JSON::XS;
$hr_search = JSON::XS::decode_json(
JSON::XS::encode_json( $hr_search )
);
my (
$s_limit,
$s
ed_selects{$or_self} = {};
# deep copy hash
require JSON::XS;
$hr_search = JSON::XS::decode_json(
JSON::XS::encode_json( $hr_search )
);
my (
$s_limit,
$s
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);
$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
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
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.
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;
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
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