th::Plugin::Articles::Site;
use Clone qw(clone);
use Cwd;
use File::Path;
use File::Slurp;
use JSON::XS;
#use Sort::Versions;
use Time::Local;
use Try::Tiny;
use XML::RSS;
#use YAML::XS;
use versio
cache/$author.json";
try {
# load JSON, if we have one
if(-f $destfile) {
$progress->( ".. processing rmauth $author $name (cleaning JSON file)" )
JSON file)" ) if(defined $progress);
my $store;
eval { $store = decode_json($data) };
$progress->( ".. processing rmauth $author $name (decoded JSON
act::LegacyReport;
use CPAN::Testers::Fact::TestSummary;
use File::Slurp;
use HTML::Entities;
use JSON::XS;
use Metabase::Resource;
use XML::RSS;
use YAML::XS;
#--------------------------------------
m DistroRSS
Return the RSS feed for a given distribution.
=item load_rss
Reads the appropriate JSON file and returns an RSS feed.
=item make_rss
Creates an RSS feed from a given data set.
=item
istroYAML
Return the YAML feed for a given distribution.
=item load_yaml
Reads the appropriate JSON file and returns an YAML feed.
=back
=cut
sub View {
if($cgiparams{id} =~ /^\d+$/) {
_name = $app_pm_basename;
$app_name =~ s/\.pm//;
return dirname($pm_location).'/'.$app_name.".json.example";
}
sub first_existing_variable {
for(@_){ return $_ if $_ }
# return (grep{$_}@_)[
mple_mojo_conf
When packaging as module Mojolicious applications that use
L<Mojolicious::Plugin::JSONConfig> or L<Mojolicious::Plugin::Config>
it's needed to create a sample file inside of it
This f
call it same as *.pm file NAME
E.g. you have CamshotBot.pm so you must name config as CamshotBot.json.example
=head2 first_existing_variable
Return first existing non-empty variable or undef from g
inth::DTUtils;
use Labyrinth::Plugin::CPAN;
use Labyrinth::Variables;
use Labyrinth::Writer;
use JSON::XS;
#----------------------------------------------------------------------------
# Public Inte
arams{name});
$tvars{update} = 1;
}
}
# decode from JSON string
my $parms = decode_json($summary[0]->{dataset});
for my $key (keys %$parms) { $tvars{$key} = $parms
(sub { $_->proxy->detect })
->get('fastapi.metacpan.org/v1/release/Minion')
->result->json->{version};
} or return;
my $msg = 'This version is up to date, have fun!';
$msg = 'Thank
r' => (
is => 'ro',
#bless(
# {
# 'content_type' => 'application/json',
# 'priority' => 1,
# 'timestamp' => 1498807603,
# 'us
random_caption abs_path_of_sample_mojo_conf fev);
use Mojolicious::Lite;
use Mojolicious::Plugin::JSONConfig;
use Mojolicious::Plugin::Webtail;
use WWW::Telegram::BotAPI;
use Date::Format;
use Telegra
ot',
getcwd.'/camshotbot.conf.json',
abs_path_of_sample_mojo_conf(__PACKAGE__),
);
print "Using config: ".$config_file_path."\n";
my $config_values = plugin 'JSONConfig' => { file => $config_fil
post '/'.$telegram_token => sub {
my $c = shift;
my $update = $c->req->json;
$c->answer($update);
$c->render(json => "ok");
};
get '/' => sub {
shift->render(text => 'bot is running');
};
::Client::VERSION = '1.1000';
use HTTP::Thin;
use HTTP::Request::Common;
use HTTP::CookieJar;
use JSON;
use URI;
use Ouch;
use Moo;
=head1 NAME
Wing::Client - A simple client to Wing's web services
_process_response {
my $self = shift;
my $response = shift;
my $result = eval { from_json($response->decoded_content) };
if ($@) {
ouch 500, 'Server returned unparsable conte
ta};
}
}
=head1 PREREQS
L<HTTP::Thin>
L<Ouch>
L<HTTP::Request::Common>
L<HTTP::CookieJar>
L<JSON>
L<URI>
L<Moo>
=head1 SUPPORT
=over
=item Repository
L<http://github.com/rizen/Wing-Client>
als;
use Labyrinth::Variables;
use Labyrinth::Plugin::Content;
use Labyrinth::Plugin::CPAN;
use JSON::XS;
use File::Find::Rule;
use File::Slurp;
use Getopt::Long;
use CPAN::Testers::Common::Article
ixed");
}
sub _check_arch_os {
my $row = shift;
my $data = decode_json($row->{report});
my $fact = decode_json($data->{'CPAN::Testers::Fact::LegacyReport'}{content});
my $textreport
$res = $self->check_request($rreq);
return $res if $res;
state $json = do {
require JSON::MaybeXS;
JSON::MaybeXS->new->allow_nonref;
};
state $ua;
state $callback
eq->{$_};
if (!defined($hv) || ref($hv)) {
$hk = "$hk-j-";
$hv = $json->encode($hv);
}
$http_req->header($hk => $hv);
}
$ua->{__log_level} = $se
ap-fmt' => 'json');
my %args;
if ($rreq->{args}) {
for (keys %{$rreq->{args}}) {
$args{$_} = $rreq->{args}{$_};
}
}
my $args_s = $json->encode(\%args)
t::Encoder::JSONXS;
$instance = Plack::Session::Store::RedisFast::Encoder::JSONXS->new;
1;
} or do {
require Plack::Session::Store::RedisFast::Encoder::MojoJSON;
$i
ast::Encoder::MojoJSON->new;
}
or do {
require Plack::Session::Store::RedisFast::Encoder::JSON;
$instance = Plack::Session::Store::RedisFast::Encoder::JSON->new;
};
en through L</redis> param.
Default implementation of serializer handle is L<JSON::XS>; otherwise L<Mojo::JSON> or L<JSON>.
May be overriden through L</inflate> and L</deflate> param.
=head1 SYNOPS
"uri=%s", $srvsch, $host, $port, $path, $args, $uri);
require JSON::MaybeXS;
state $json = JSON::MaybeXS->new->allow_nonref;
my $attempts = 0;
my $do_retry;
my $e;
my $req_json;
eval { $req_json = $json->encode($req) };
$e = $@;
return [400, "Can't encode request as JSON: $e"] if $e;
$out->write("j$req_json\015\012");
log_trace("Sent request to server: %s", $req_json);
# XXX alarm/timeout
my $line = $in->getline;
log_trace("Got line from server: %s", $line);
if (!$line) {
#special handle HASH refs ( interpret as json)
if ( ( ref($res) eq 'HASH' ) and $response->wantformat('json') ) {
$res = $response->set_json( $res );
}
#check if response moda
$data;
return $self;
}
sub json : lvalue {
my $self = shift;
$self->{__json};
}
sub set_json {
my $self = shift;
my $data = shift;
$self->json = $data;
return $self;
}
sh a notification on Slack after release
use Moose;
with 'Dist::Zilla::Role::AfterRelease';
use JSON;
use LWP::UserAgent;
use Dist::Zilla::Plugin::EmailNotify;
use namespace::autoclean;
has webhoo
= $ua->post( $self->webhook_url,
'Content-Type' => 'application/json',
Content => encode_json( \%payload ),
);
}
return $res->is_success;
}
sub _build_
package Plack::Session::Store::RedisFast::Encoder::JSONXS;
use strict;
use warnings;
use 5.008_005;
use JSON::XS ();
sub new {
return JSON::XS->new->utf8->allow_nonref;
}
1;
__END__
=pod
=
oding utf-8
=head1 NAME
Plack::Session::Store::RedisFast::JSONXS - L<JSON::XS> adapter for Redis session store.
=head1 DESCRIPTION
L<JSON::XS>-based implementation of L<Plack::Session::Store::Redi
flate>.
=head1 SYNOPSIS
use Plack::Session::Store::RedisFast::JSONXS;
my $encoder = Plack::Session::Store::RedisFast::JSONXS->new;
my $bytes = $encoder->encode( $hashref );
my $ha
=> 'frontend/Makefile.am',
'frontend/Manifest.json' => 'frontend/Manifest.json',
'frontend/config.json' => 'frontend/config.json',
'frontend/source/class/app/Application.js' =
d by the Pages module to create the leaderboard pages.
Previously this information was held in a JSON file, but maintaining accurate
data has been problematic.
Note that this package should not be c
ur $VERSION = 1.7;
use strict;
use warnings;
use Moose;
use namespace::autoclean;
use JSON::Tiny qw(encode_json);
use Sys::Hostname;
use Data::UUID;
use POSIX qw(strftime);
use Log::Log4perl;
use
;
{ $self->short_message() } #fire off lazy message builder
return {%$self};
}
sub TO_JSON {
my $self = shift;
{ $self->short_message() } #fire off lazy message builder
retu
:Basename;
use File::Copy;
use File::Path;
use File::Slurp;
use HTML::Entities;
use IO::File;
use JSON;
use Sort::Versions;
use Template;
#use Time::HiRes qw ( time );
use Time::Piece;
use Try::Tiny;
item * update_full
Full update of data and pages.
=item * update_data
Update data and store in JSON format.
=item * build_basics
Create the basic set of pages,those require no statistical calcula
return unless(-f $storage);
my $data = read_file($storage);
my $store = decode_json($data);
return $store->{$type};
}
# for $type (qw(stats dists fails perls pass pl