phone at
L<https://secure.backblaze.com/account_settings.htm?showPhone=true>
=item 4. Create a JSON file named C<B2.credentials>
This file should live in your
home directory
with the application k
package WebService::Minecraft::Fishbans;
use 5.006;
use strict;
use Moo;
use LWP::UserAgent;
use JSON;
our $VERSION = '0.02';
=head1 NAME
WebService::Minecraft::Fishbans - look for bans for a Mine
{
die "Failed to query Fishbans - " . $response->status_line;
}
my $result = JSON::from_json($response->decoded_content)
or die "Failed to parse Fishbans response";
if (!$r
::AttributeShortcuts;
use Types::Standard qw/Str HashRef/;
use Types::URI qw/Uri/;
use JSON::MaybeXS 'decode_json';
use Path::Tiny;
with 'Badge::Depot';
has author => (
is => 'ro',
isa => St
sion,
};
}
return {} if !path('META.json')->exists;
my $json = path('META.json')->slurp_utf8;
my $data = decode_json($json);
return {} if !exists $data->{'name'} || !exi
sion> and C<dist> are set to the values in the Dist::Zilla object.
=item 2
If there is a C<META.json> in the distribution root then that is used to set C<version> and C<dist>.
=back
If neither of
package WebService::Instagram;
use 5.006;
use strict;
use warnings;
use JSON;
use LWP::UserAgent;
use URI;
use Carp;
use Data::Dumper;
use HTTP::Request;
use Safe::Isa;
our $VERSION = '0.09';
use
application/x-www-form-urlencoded');
$req->content($uri->query);
my $res = from_json($self->{browser}->request($req)->content);
# print Dumper $res;
# $self->{access_token} = $res->
e = $self->{browser}->get($uri->as_string);
my $ret = $response->decoded_content;
return decode_json $ret;
}
1; # End of WebService::Instagram
__END__
=head1 NAME
WebService::Instagram - Simple I
ests/*.t scripts
# * the bin/slackware-systemtests test harness
use strict;
use warnings;
use JSON;
use File::Valet;
use Time::HiRes;
use vars qw(@EXPORT @EXPORT_OK @ISA $VERSION);
BEGIN {
re
err_ar => [],
me => 'Linux::Slackware::SystemTests',
js_or => JSON->new->ascii->allow_nonref->space_after()
};
bless ($self, $class);
foreach my $k0 (k
q "64") {
# run test specific to 64-bit Slackware
}
# If you need to JSONify something, there's already a JSON object
# instantiated with sane and robust operating parameters:
ok `/bin
}
elsif ($tx->res->headers->content_type =~ m!^(application/json|text/javascript)(;\s*charset=\S+)?$!) {
$data = $tx->res->json;
}
else {
$data = Mojo::Parameters->new($tx->res->body)
head1 ADDITIONAL HELPERS
=head2 oauth2.process_tx
This helper is usefull for processing any API json response:
my $tx = $c->app->ua->get($profile_url); # blocking example
my ($data, $err) = $c-
Tamer Rizk <foss[at]inficron.com>
use strict;
use Cwd;
use DBI;
use Redis;
use Date::Parse;
use JSON::XS;
use Mail::SpamAssassin;
use MIME::Lite;
use Sys::SigAction qw( timeout_call );
use MIME::Bas
>disconnect if($db);
}
sub c_param {
fatal('[c_params]: missing conf') if (!$_[0]);
my $conf = JSON::XS->new->utf8->decode(decode_base64($_[0]));
fatal('[c_params]: Invalid number of params '.join
ncode_base64(JSON::XS->new->utf8->encode($self->{conf}),'');
#$c->last( new Config::Crontab::Env( -name => 'MAIL_SPAMASSASSIN_CONTRIB_PLUGIN_IPFILTER', -value=> '"'.encode_base64(JSON::XS->new->u
generation --- generate files
#pod #
#pod [ModuleBuild]
#pod [MetaYAML]
#pod [MetaJSON]
#pod [Manifest]
#pod [License]
#pod [ReadmeAnyFromPod]
#pod [CPANFile]
#pod
#pod
# add META.yml (supports CPAN::Meta::Spec v1.4)
'MetaJSON', # add META.json (supports CPAN::Meta::Spec v2.0 upwards)
'CPANFile',
};
if ($dzil_meta->install_json) {
$self->log("Excluding packages of Dist::Zilla distribution");
$dzil_pkg = $dzil_meta->install_json_hash->{provides};
}
a1_hex);
use URI::Escape;
use App::TimeTracker::Utils qw(error_message);
use Encode;
use JSON::XS qw(encode_json);
has 'tell_slack' => (
is => 'ro',
isa => 'Bool',
de
oad->{username} = $cfg->{username} if $cfg->{username};
$request->content(decode_utf8(encode_json($payload)));
my $res = $ua->request($request);
unless ( $res->is_success ) {
erro
XML::LibXML;
use HTML::Selector::XPath qw/selector_to_xpath/;
use Carp qw/ confess /;
use JSON qw/ decode_json /;
our $VERSION = "0.08";
our @EXPORT_OK = qw/ j fn /;
our @EXPORT = qw/ j /;
use cons
] =~ /^\d+$/;
# json array or object
return decode_json($_[0])
if $_[0] =~ /^(?:\{|\[)/;
# boolean
return JSON::true if $_[0] eq 'true';
return JSON::false if $_[0] eq
s::Validate;
use MooseX::WithCache;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
use JSON;
use Class::Date qw/gmdate/;
use POSIX; #strftime
use YAML qw/Dump LoadFile DumpFile/;
use Encode
h = HTTP::Headers->new();
$h->header( 'Content-Type' => "application/json" );
$h->header( 'Accept' => "application/json" );
my $data;
#Only password flow allows refresh tokens
if(
TP::Headers->new();
$h->header( 'Content-Type' => "application/json" );
$h->header( 'Accept' => "application/json" );
$h->header( 'Authorization' => "Bearer " . $self->valid_ac
PROTOCOL://$STREAMING_SERVER/1.1/statuses/filter.json" } ],
sample => [ GET => sub { "$PROTOCOL://$STREAMING_SERVER/1.1/statuses/sample.json" } ],
firehose => [ GET => sub { "$PROT
sub { "$US_PROTOCOL://$USERSTREAM_SERVER/1.1/user.json" } ],
sitestream => [ GET => sub { "$PROTOCOL://$SITESTREAM_SERVER/1.1/site.json" } ],
# DEPRECATED
links
{ "$PROTOCOL://$STREAMING_SERVER/1/statuses/links.json" } ],
retweet => [ GET => sub { "$PROTOCOL://$STREAMING_SERVER/1/statuses/retweet.json" } ],
);
sub new {
my $class = shift;
m
10 ? $current : substr $current, 0, 510 ;
}
(blessed $self)->new(raw_line => $new)
}
sub TO_JSON {
my ($self) = @_;
+{
command => $self->command,
prefix => $self->prefix,
params
TY TO],
qq[ PUT AN IRCD ON A ROOMBA\n]
unless caller; 1;
=pod
=for Pod::Coverage BUILDARGS TO_JSON has_\w+
=head1 NAME
IRC::Message::Object - Incoming or outgoing IRC events
=head1 SYNOPSIS
use Carp;
use Scalar::Util 'reftype';
## These two must be present anyway:
use YAML::XS ();
use JSON::MaybeXS ();
use Fcntl ':flock';
use Time::HiRes 'sleep';
use Scalar::Util 'blessed';
use Bot:
builder => sub {
+{
YAML => 'YAML::Syck',
YAMLXS => 'YAML::XS',
JSON => 'JSON::MaybeXS',
}
},
);
has yamlxs_from_ref => (
is => 'rw',
lazy => 1,
ire YAML::Syck; YAML::Syck::Load($_[0]) },
);
has json_from_ref => (
is => 'rw',
lazy => 1,
coerce => sub {
my $jsify = JSON::MaybeXS->new(
utf8 => 1, allow_nonref => 1
tware, licensed under:
The Artistic License 2.0 (GPL Compatible)
=head1 SEE ALSO
L<Mojo::DOM>, L<HTML::TreeBuilder>, L<XML::LibXML>, L<XML::Twig>, L<XML::Smart>
=for Pod::Coverage TO_JSON
=cut
=> 'rw',
isa => Object,
builder => sub {
Bot::Cobalt::Serializer->new(Format => 'JSON')
},
);
{ no warnings 'once'; *Serializer = *serializer; }
## _orig is the original tie().
has
e_key(
sub { $_ .= "\0" }
);
## JSONified values
$self->DB->filter_fetch_value(
sub {
s/\0$//;
$_ = $self->serializer->ref_from_json($_)
unless $self->raw;
}
)
;
$self->DB->filter_store_value(
sub {
$_ = $self->serializer->json_from_ref($_)
unless $self->raw;
$_ .= "\0";
}
);
1
}
sub dbclose {
my ($self) = @_;
unless
serialize arbitrary data structures to some
standardized format. Serialization formats such as B<JSON> and B<YAML>
are convenient for "speaking" to other networked applications, sharing
data, or sa
## create a JSON serializer:
my $jsify = Bot::Cobalt::Serializer->new( Format => 'JSON' );
## serialize a perl hash:
my $ref = { Some => { Deep => [ 'Structure' ] } };
my $json = $jsify->fr
ot::Cobalt::Common;
use Bot::Cobalt::Serializer;
our $Serializer = Bot::Cobalt::Serializer->new('JSON');
use HTTP::Request;
use Module::CoreList;
use Try::Tiny;
our $HelpText
= 'try: dist, late
info for $dist ($status)"
);
}
return PLUGIN_EAT_ALL
}
my $json = $response->content;
unless ($json) {
broadcast('message',
$hints->{Context}, $hints->{Channel},
ed for $dist",
);
return PLUGIN_EAT_ALL
}
my $d_hash =
try { $Serializer->thaw($json) }
catch {
broadcast( 'message',
$hints->{Context}, $hints->{Channel},
package JMAP::Validation::Checks::Boolean;
use Test2::Bundle::Extended;
our $is_boolean = validator(sub {
my (%params) = @_;
return (ref($params{got}) || '') eq 'JSON::PP::Boolean';
});
1;
::Tests::SetError;
use JMAP::Validation::Tests::String;
use JSON::Typist;
use Test2::Bundle::Extended;
# record types {{{
my $typist = JSON::Typist->new();
my %ContactGroup_checks = (
id => $JMAP