0;
use experimental 'class';
# NAME
# ====
#
# Daje::Workflow::Loader - Just loads Daje-Workflow JSON based workflows
#
#
# SYNOPSIS
# ========
#
# use Daje::Workflow::Loader;
#
# my $workflows
es possible ####################
=head1 NAME
Daje::Workflow::Loader - Just loads Daje-Workflow JSON based workflows
=head1 SYNOPSIS
use Daje::Workflow::Loader;
my $workflows = Daje::Wo
na->reader(
url => "https://lnation.org",
jsonSchema => { ... },
instruction => "...",
headers => {
"Accept" => 'application/json',
"X-Respond-With" => "reade
e Mojo::Base -base, -signatures;
use Mojo::JSON qw {decode_json from_json};
use Mojo::File;
# NAME
# ====
#
# Daje::Workflow::Loader::Load - Loads the JSON based workflows and put them in a hash
#
#
>load();
#
# DESCRIPTION
# ===========
#
# Daje::Workflow::Loader::Load is loading workflows from JSON files in a set folder
#
# LICENSE
# =======
#
# Copyright (C) janeskil1525.
#
# This library is f
>basename(), '.json'));
if($tag ne "database") {
$workflow->{$tag} = from_json($path->slurp())->{workflow};
} else {
$workflow->{$tag} = from_json($path->slurp(
g::Common;
use SReview::Config;
use strict;
use warnings;
use feature 'state';
use Mojo::JSON qw/decode_json/;
sub get_default_cfile {
my $dir = $ENV{SREVIEW_WDIR};
my $write = shift;
$dir = ".
{SREVIEW_S3_DEFAULT_HOST};
}
if(exists($ENV{SREVIEW_S3_EXTRA_CONFIGS})) {
my $extras = decode_json($ENV{SREVIEW_S3_EXTRA_CONFIGS});
foreach my $extra(keys %$extras) {
$rv->{$extra} = $extras-
package WebService::Jina::UA;
use Moo;
use URI;
use LWP::UserAgent;
use JSON::Lines;
use MIME::Base64 qw/encode_base64/;
use WebService::Jina::Response;
has api_key => (
is => 'ro',
lazy => 1,
r
$ua->default_header('User-Agent' => 'Mozilla/5.0');
return $ua;
}
);
has json => (
is => 'ro',
default => sub {
JSON::Lines->new;
}
);
sub get {
shift->request(
type => 'GET',
@_
);
}
dd_handler(response_data => sub {
my($response, $ua, $handler, $data) = @_;
$data = $self->json->decode($data);
for (@{$data}) {
$stream_cb->(WebService::Jina::Response->new(%{$_}));
s::Gnuplot;
use JSON::XS qw(decode_json);
use LWP::UserAgent;
use DateTime;
use Try::Tiny;
use Path::Tiny;
sub get_data($) {
my $symbol = shift;
my $filename = lc "$symbol.json";
my $cont
ef;
}
}
if (defined $content and length($content)) {
my $jquotes = decode_json $content;
if (ref $jquotes eq 'ARRAY' and scalar(@$jquotes)) {
## sort quotes
ta::Dumper;
sub add {
my $c = shift->openapi->valid_input or return;
return add_with_json($c, $c->req->json, "events", $c->openapi->spec('/components/schemas/Event/properties'));
}
sub update {
r return;
my $eventId = $c->param("eventId");
my $event = $c->req->json;
$event->{id} = $eventId;
return update_with_json($c, $event, "events", $c->openapi->spec('/components/schemas/Event/pr
use constant META_JSON => sub { return @_
? File::Spec->catfile( @_, 'META.json' )
: 'META.json';
e constant MYMETA_JSON => sub { return @_
? File::Spec->catfile( @_, 'MYMETA.json' )
: 'MYMETA.json';
e Media::Convert::Asset::ProfileFactory;
use Mojo::Pg;
use Mojo::Template;
use Mojo::JSON qw/encode_json decode_json/;
use SReview::Config::Common;
use SReview::Talk::State;
use SReview::Talk::Progres
cute($self->talkid);
my $row = $st->fetchrow_arrayref;
if(defined($row->[0])) {
return decode_json($row->[0]);
}
return {};
}
has 'active_stream' => (
is => 'rw',
builder => '_probe_stream',
if($self->_has_flags) {
$db->prepare("UPDATE talks SET flags=? WHERE id = ?")->execute(encode_json($self->flags), $self->talkid);
}
if($self->has_stream) {
$db->prepare("UPDATE talks SET activ
package WebService::Jina::Response;
use Moo;
use JSON::Lines qw/jsonl/;
has [qw/
id
choices
model
object
usage
system_fingerprint
created
data
results
num_tokens
tokenizer
num_chunks
c
rict;
use warnings;
package SReview::Config;
use Data::Dumper;
use Carp;
use Mojo::JSON qw/decode_json encode_json/;
use Text::Format;
=head1 NAME
SReview::Config - Self-reproducing and self-docum
efault;
my $NAME = uc $name;
if(exists($ENV{"SREVIEW_${NAME}"})) {
$self->set($name => decode_json($ENV{"SREVIEW_${NAME}"}));
}
};
=head2 $config->define_deprecated(oldname, newname, conversion_
}
my $NAME = uc $oldname;
if(exists($ENV{"SREVIEW_${NAME}"})) {
$self->set($newname => decode_json($ENV{"SREVIEW_${NAME}"}));
}
}
=head2 $config->define_computed('name')
Defines a default value
l
use strict;
use warnings;
use PDL;
use PDL::NiceSlice;
use PDL::Finance::TA;
use JSON::XS qw(decode_json encode_json);
use LWP::UserAgent;
use DateTime;
use Try::Tiny;
use Path::Tiny;
use Template;
use Browser::Open;
sub get_data($) {
my $symbol = shift;
my $filename = lc "$symbol.json";
my $content;
my $qdata;
my $url = sprintf("https://api.gemini.com/v2/candles/%s/%s", lc
ef;
}
}
if (defined $content and length($content)) {
my $jquotes = decode_json $content;
if (ref $jquotes eq 'ARRAY' and scalar(@$jquotes)) {
## sort quotes
YPE talkstate;
ALTER TYPE talkstate_new RENAME TO talkstate;
-- 21 up
ALTER TABLE talks ADD flags json;
-- 21 down
ALTER TABLE talks DROP flags;
-- 22 up
CREATE TYPE talkstate_new AS ENUM (
'waiti
lename);
ALTER TABLE talks ALTER flags TYPE jsonb;
-- 23 down
ALTER TABLE raw_files DROP CONSTRAINT unique_filename;
ALTER TABLE talks ALTER flags TYPE json;
-- 24 up
CREATE TYPE talkstate_new AS ENUM
my $c = shift->openapi->valid_input or return;
my $room = $c->req->json;
return add_with_json($c, $room, "rooms", $c->openapi->spec('/components/schemas/Room/properties'));
}
my $roomId = $c->param('roomId');
my $room = $c->req->json;
$room->{id} = $roomId;
return update_with_json($c, $room, "rooms", $c->openapi->spec('/components/schemas/Room/
d(1) :content_type(image/gif) { }
sub static_json :get(static) :view(static) :delayed :path(static/(.*\.json)) :captured(1) :content_type(application/json) { }
sub static_html :get(static) :view(sta
tured(1) :content_type(image/gif) { }
sub static_json :get(static) :view(static) :path(static/(.*\.json)) :captured(1) :content_type(application/json) { }
sub static_html :get(static) :view(static)
elf) = @_;
$self->static_directory ||= 'root/static';
$self->allowed = 'js|css|png|svg|jpeg|gif|json|html|txt|eot|ttf|woff|woff2|mov|mp4';
$self->mime = {
js => 'application/javascript',
css =>
g => 'image/png',
svg => 'image/svg',
jpeg => 'image/jpeg',
gif => 'image/gif',
json => 'application/json',
html => 'text/html',
txt => 'text/plain',
eot => 'application/vnd.ms-fontobjec
ssage . " at " . $_[0]->filepath . " line " . $_[0]->line . "\n";';
$META{stringify}{json} ||= 'require JSON; JSON->new->encode($_[0]->hash);';
push @methods, sprintf "sub stringify_%s { %s }", $_,
, '>', 'glitch.log';
print $fh $_[0] . "\n";
close $fh;
},
glitch_stringify_format => 'json',
one => {
message => 'Create a new glitch error message'
},
two => {
message => 'A d
s another error messsage"
}
}
package Foo;
use JSON;
use Glitch (
glitch_config => 'glitch.conf'
glitch_config_parser => sub {
JSON->new->decode($_[0]);
}
);
sub bar {
eval {
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigData'
/config/legend:
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
type:
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref:
if $^V >= v5.38, warnings => 'experimental::class';
use Net::LastFM;
use Getopt::Long;
use JSON;
our $VERSION = '0.0.10';
field $username :param = 'davorg';
field $period :param =
artists;
field $renderer = {
text => \&render_text,
html => \&render_html,
json => \&render_json,
};
method run {
GetOptions(
'user=s' => \$username,
'period=s
method render_json {
my $pos = 1;
my @data = map { {
position => $pos++,
name => $_->{name},
count => $_->{playcount},
} } @artists;
say JSON->new->canonica