or above library.
=head1 SETUP MAP
C<Map::Tube v3.22> or above now supports map data in XML and JSON format. Here is
the Structure of map in XML format:
<?xml version="1.0" encoding="UTF-8"?>
.
.....
.....
.....
</stations>
</tube>
And same in JSON format:
{
"name" : "Your-Map-Name",
"lines" : {
"line" : [
line="L1:8" link="L07" />
</stations>
</tube>
Next is the JSON representation C<sample.json> of the above map:
{
"name" : "Sample",
"lines" : { "line
d/;
use TOML::Dumper::Name;
use TOML::Dumper::String;
our @BOOLEAN_CLASSES = qw/
JSON::PP::Boolean
JSON::XS::Boolean
/;
sub new {
my ($class, %args) = @_;
my ($name, $atom) = @args{
leware::WOVN::Store;
use strict;
use warnings;
use utf8;
use parent 'Class::Accessor::Fast';
use JSON;
use LWP::UserAgent;
use Plack::Middleware::WOVN::Lang;
__PACKAGE__->mk_accessors(qw/ config_lo
en&url=$url");
my $values = {};
if ( $res->is_success ) {
$values = eval { JSON::decode_json( $res->content ) } || {};
}
$values;
}
1;
__END__
=head1 NAME
Plack::Middlewa
::Socket::SSL;
use MIME::Base64;
use Furl;
use JSON::MaybeXS ();
use Moo;
use URI;
use Net::Moip::V2::Endpoint;
our $VERSION = "0.06";
my $JSON = JSON::MaybeXS->new->utf8;
has 'ua', is => 'ro', de
> 'no-cache'
], $body);
return { error => $res->status_line } if $res->code >= 500;
$JSON->decode($res->content);
}
sub endpoint {
my ($self, $path, $params) = @_;
die "Syntax
my $endpoint = shift;
$self->endpoint($endpoint)->post(@_);
}
sub decode_json {
my $self = shift;
$JSON->decode($_[0]);
}
1;
__END__
=encoding utf-8
=head1 NAME
Net::Moip::V2 -
use App::Environ;
use App::Environ::Config;
App::Environ::Config->register( qw( foo.yml bar.json ) );
App::Environ->send_event('initialize');
my $config = App::Environ::Config->instance;
et::Moip::V2::Endpoint;
use IO::Socket::SSL;
use MIME::Base64;
use Furl;
use JSON::MaybeXS ();
use Moo;
my $JSON = JSON::MaybeXS->new->utf8;
has 'path', is => 'ro', required => 1;
has 'api_url',
on/json',
'Authorization' => $self->_authorization_string
]);
}
sub post {
my ($self, $data) = @_;
$self->ua->post($self->url, [
'Content-Type' => 'application/json',
'Authorization' => $self->_authorization_string
], $JSON->encode($data) );
}
sub oauth_get {
my $self = shift;
local $self->{is_oauth} = 1;
$self->get(@_);
}
sub oauth_post
ON = eval $VERSION;
use Carp;
use Future;
use Future::Utils qw( repeat );
use JSON::MaybeXS qw( encode_json decode_json );
use Data::Dump 'pp';
use File::stat;
use List::Util 1.29 qw( pairmap );
us
shift;
return $v if !ref $v or blessed $v;
return $v if ref $v ne "HASH";
return encode_json( $v );
}
sub _uri_for_path
{
my $self = shift;
my ( $path, %params ) = @_;
$path = "/$
};
# Some parameter values can be JSON-encoded objects
$uri->query_form( pairmap { $a => _maybe_encode $b } %params );
return $uri;
}
sub _do_GET_json
{
my $self = shift;
my ( $path,
undef;
}
sub _do_GET_json
{
my $self = shift;
my ( $path, @args ) = @_;
$self->{matrix}->_do_GET_json( "/rooms/$self->{room_id}" . $path, @args );
}
sub _do_PUT_json
{
my $self = shift
>{matrix}->_do_PUT_json( "/rooms/$self->{room_id}" . $path, $content );
}
sub _do_POST_json
{
my $self = shift;
my ( $path, $content ) = @_;
$self->{matrix}->_do_POST_json( "/rooms/$self->{
ew room name.
=cut
sub set_name
{
my $self = shift;
my ( $name ) = @_;
$self->_do_PUT_json( "/state/m.room.name", { name => $name } )
->then_done();
}
=head2 aliases
@aliases =
= '0.01';
$VERSION = eval $VERSION;
use Mojo::DOM;
use Mojo::IOLoop;
use Mojo::JSON qw(encode_json j);
use Mojo::JSON::Pointer;
use Mojo::UserAgent;
use Mojo::Util qw(decode encode getopt);
use Scal
$method, $url, \%headers, $content));
my $res = $tx->result;
# JSON Pointer
next unless defined $selector;
_json($buffer, $selector) and next if !length $selector || $selector =~ m!^/
ld_start_line, $_[0]->headers->to_string, "\n\n" }
sub _json {
return unless my $data = j(shift);
return unless defined($data = Mojo::JSON::Pointer->new($data)->get(shift));
return _say($data)
HTTP::Request::Params;
use URI::Escape;
use Data::Dumper;
use CGI::Cookie;
use MIME::Base64;
use JSON;
use Digest::SHA qw(sha256_base64);
use Crypt::OpenSSL::Random;
use Data::Validate::Struct;
use D
elf->{authbasic});
$res->code(HTTP_UNAUTHORIZED);
$res->header('Content-type' => 'application/json; charset=UTF-8');
$res->add_content("{ \"error\": \"please authenticate\" }");
return 0;
}
s
my $data;
if ($req->content) {
if ($req->content =~ /^\{/) {
eval { $data = decode_json($req->content); };
}
else {
# try decoding as query
my $query = HTTP::Request
hat. That way you can
# interactively browse XML or YAML files. Supported suffixes are: xml,
# json, csv, yml, ini, conf.
# If the data structure evaulates, you'll be dropped into an interactive
#
elsif ($arg =~ /\.json$/i) {
eval { require JSON; };
die "Sorry, JSON is not installed, JSON not supported!\n" if($@);
my $json = JSON->new->utf8();
$code = $json->decode(slurp($arg)
se 5.008005;
use Mouse;
our $VERSION = "0.01";
use Furl;
use URI;
use Carp ();
use JSON qw(decode_json encode_json);
my $api_base_uri = 'https://www.pivotaltracker.com/services/v5/';
has 'token' =
$self->timeout );
},
);
no Mouse;
sub _request {
my ($self, $method, $end_point, $data_json, @additional_header) = @_;
my $ua = $self->ua;
my $uri = $self->api_base_uri . $end_poin
= Furl::Request->new($method, $uri, ['X-TrackerToken' => $self->token, @additional_header], $data_json);
my $res = $ua->request($req);
unless ( $res->is_success ) {
Carp::croak $res->s
.hiv.lanl.gov/content/sequence/LOCATE/locate.html>
web tool and is also used to power
L<a simple, JSON-based web API|https://indra.mullins.microbiol.washington.edu/locate-sequence/>
for the same tool
tself.
=head1 EXAMPLE RESULTS
# Using @sequences from the SYNOPSIS above
use JSON;
print encode_json(\@sequences);
__END__
[
{
"query" : "sequence_1",
toclean;
use Moose;
use MooseX::SetOnce;
use AnyEvent;
use Data::Dumper;
use HTTP::Request;
use JSON;
use LWP::UserAgent;
use URI;
use App::RoboBot::Channel;
use App::RoboBot::Response;
extends 'A
) as polled_at
}, $repo->{'repo_id'});
return unless $poll_t && $poll_t->next;
my ($json, @notices);
my $api_path = ['repos',$repo->{'owner_name'},$repo->{'repo_name'},'commits'];
) {
if (ref($json) eq 'ARRAY' && @{$json} > 0) {
my $oldest_commit;
my %commiters;
my @commits;
foreach my $commit (@{$json}) {
toclean;
use Moose;
use MooseX::SetOnce;
use AnyEvent;
use Data::Dumper;
use HTTP::Request;
use JSON;
use LWP::UserAgent;
use URI;
use App::RoboBot::Channel;
use App::RoboBot::Response;
extends 'A
rn unless $response->is_success;
my $json;
eval {
$json = decode_json($response->decoded_content);
};
return if $@;
return $json;
}
sub _run_watcher {
my ($self, $bo
t) = @_;
# TODO: Call base API path, get JSON
# TODO: Loop through keg list, compare each one's last_updated with the
# plugin's last_check attribute. Any with a new update should
use namespace::autoclean;
use Moose;
use MooseX::SetOnce;
use AnyEvent;
use Data::Dumper;
use JSON;
use Scalar::Util qw( blessed );
use App::RoboBot::Channel;
use App::RoboBot::Message;
use App::
ttps://example.com/api/tickets?"
(query-string { :status "open" :format "json" }))))))
=head2 delete-alarm
=head3 Description
Permanently removes the named alarm from the c
, { format => $format, pattern => $pattern });
}
}
$alarm{'exclusions'} = encode_json($alarm{'exclusions'} // []);
$res = $self->bot->config->db->do(q{
update alarms_alar
v::VERSION = '4.004';
use v5.20;
use namespace::autoclean;
use Moose;
use MooseX::SetOnce;
use JSON;
use Lingua::EN::Tagger;
use List::Util qw( shuffle );
extends 'App::RoboBot::Plugin';
=head1 f
structure_jsonb,
used_count, used_count::float / usemax.m * 100 * random()
from markov_sentence_forms,
usemax
where nick_id in ???
and jsonb_array_l
ength(structure_jsonb) between 5 and 20
and structure_jsonb \?& regexp_split_to_array(?, '[[:space:]]')
and structure like ?
order by 6 desc
limit 1
}, \@ni
Id};
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('PUT', 'application/json', $creds, $main->baseUrl . $uri, $vars);
return $response;
}
1;
Moose;
use MooseX::SetOnce;
use AnyEvent;
use Data::Dumper;
use DateTime;
use HTTP::Request;
use JSON;
use LWP::UserAgent;
use LWP::Protocol::https;
use URI;
use App::RoboBot::Channel;
use App::Robo
n/json' );
$req->header( 'Authorization' => sprintf('Token token=%s', $group->{'api_key'}) );
my $response = $self->ua->request($req);
return unless $response->is_success;
my $json;
eval {
$json = decode_json($response->decoded_content);
};
return if $@;
return $json;
}
sub now {
my ($self) = @_;
return DateTime->now->iso8601 . 'Z';
}
sub _vali
n;
use Moose;
use MooseX::SetOnce;
use AnyEvent;
use AnyEvent::SlackRTM;
use Data::Dumper;
use JSON;
use LWP::Simple;
use App::RoboBot::Channel;
use App::RoboBot::Message;
use App::RoboBot::Nick;
ta
from channels
where network_id = ? and extradata @> ?
}, $self->id, encode_json({ slack_id => $slack_id }));
if ($res && $res->next) {
$channel = App::RoboBot::Chan
=> $res->{'id'},
name => $res->{'name'},
extradata => decode_json($res->{'extradata'}),
network => $self,
config => $self->bot->co