'portable');
return;
}
sub parse {
my $me = shift;
my ($filename) = @_;
require JSON::Eval;
$decoder ||= JSON::Eval->new($me->_get_parser);
my $tomltext = do {
open my $fh, '<', $filename
ngs::register;
use Carp ();
use Encode ();
use JSON::MaybeXS ();
use constant DEBUG => $ENV{TELEGRAM_BOTAPI_DEBUG} || 0;
our $VERSION = "0.12";
my $json; # for debugging purposes, only defined when D
UserAgent; 1" or
die "Either Mojo::UserAgent or LWP::UserAgent is required.\n$@";
$json = JSON::MaybeXS->new (pretty => 1, utf8 => 1) if DEBUG;
}
# Debugging functions (only used when DEB
dump) = splice @_, -2;
_dprintf @_ if @_;
printf "%s = %s", $varname, defined $to_dump ? $json->encode ($to_dump) : "undefined\n";
}
# %settings = (
# async => Bool,
# token =
VI
ps # Postscript
byte # Swim Bytecode
Options:
--meta=<file> # YAML or JSON file containing metadata
--wrap # Attempt to wrap output to 80 cols
--complete
content_type => ['text/css','text/html','text/javascript','application/javascript', 'application/json'],
vary_user_agent => 1;
$app;
};
}
#######################################################
WebService::Europeana;
use warnings;
use strict;
use version; our $VERSION = qv('0.0.3');
use JSON;
use Log::Any;
use LWP::UserAgent;
use Moo;
use Method::Signatures;
use Try::Tiny;
use URL::Encod
e = undef;
my $json_result = undef;
my $result_ref = undef;
$query_string = sprintf( "%s%s?wskey=%s&rows=%s&query=%s&profile=%s",
$self->api_url, "search.json", $self->wskey, $
uery_string );
$response = $ua->get($query_string);
if ($response->is_success) {
$json_result = $response->decoded_content; # or whatever
}
else {
$self->log->errorf("Pr
ing Fireball|http://daringfireball.net/archive>), and syndication documents in Atom and L<JSON Feed|http://jsonfeed.org> formats. All these are constructed from simple, customizable templates.
That's
ge. It will also appear in the recent-posts sidebar of every other entry, as well as the Atom and JSON Feed documents (unless you decided to manually backdate the entry by specifying your own date att
r $subdir or die "Can't create subdir $subdir: $!";
}
foreach ( qw( archive atom jsonfeed post wrapper tags ) ) {
my $template = Path::Class::File->new(
$d
>
EOF
jsonfeed => <<EOF,
{
"version": "https://jsonfeed.org/version/1",
"title": "[% plerd.title %]",
"home_page_url": "[% plerd.base_uri %]",
"feed_url": "[% plerd.base_uri %]/feed.json",
"
his site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL — [% plerd.base_uri %]/feed.json — and add it your reader.",
"author": {
w( markdown );
use URI;
use HTML::Strip;
use Data::GUID;
use HTML::SocialMeta;
use Try::Tiny;
use JSON;
use Path::Class::File;
use Plerd::SmartyPants;
use Web::Mention;
use Readonly;
Readonly my $WP
words-per-minute reading speed to assume
Readonly my $WEBMENTIONS_STORE_FILENAME => 'webmentions.json';
has 'plerd' => (
is => 'ro',
required => 1,
isa => 'Plerd',
weak_ref => 1,
);
handles => {
mention_count => 'count',
},);
has 'json' => (
is => 'ro',
isa => 'JSON',
default => sub { JSON->new->convert_blessed },
);
sub _build_publication_file {
use v5.10.1;
package DBD::Neo4p;
use strict;
use warnings;
use REST::Neo4p 0.3030;
use JSON;
require DBI;
no warnings qw/once/;
BEGIN {
$DBD::Neo4p::VERSION = '0.2001';
}
our $err = 0;
H|ARRAY/) {
$key_from_data = $data{$k}{_node} || $data{$k}{_relationship};
$key_from_data = JSON->new->utf8->encode($data{$k}) unless $key_from_data;
}
default {
die "whaaa? (fetchall_hashr
template_file' => (
is => 'ro',
isa => 'Path::Class::File',
lazy_build => 1,
);
has 'jsonfeed_template_file' => (
is => 'ro',
isa => 'Path::Class::File',
lazy_build => 1,
);
has 'rss_file' => (
is => 'ro',
isa => 'Path::Class::File',
lazy_build => 1,
);
has 'jsonfeed_file' => (
is => 'ro',
isa => 'Path::Class::File',
lazy_build => 1,
);
has 'rece
publish_archive_page;
$self->publish_recent_page;
$self->publish_rss;
$self->publish_jsonfeed;
$self->clear_recent_posts;
$self->clear_posts;
$self->clear_post_index_hash;
Moose;
use Path::Class::Dir;
use Data::GUID;
use Web::Mention;
use Scalar::Util qw(blessed);
use JSON;
use Try::Tiny;
use Carp qw(croak);
use Readonly;
Readonly my $DEFAULT_DIR_NAME => 'webmention_i
) && $wm->isa( "Web::Mention" ) ) {
croak "Not a Web::Mention object!";
}
my $json = JSON->new->convert_blessed->encode( $wm );
my $file = Path::Class::File->new(
$self->
rectory->children(no_hidden=>1) ) {
try {
push @wms, Web::Mention->FROM_JSON( decode_json( $file->slurp(iomode => '<:encoding(UTF-8)')) );
}
catch {
die "Failed to de
$self->errors;
}
}
=head2 TO_JSON
Returns a hash reference of L</valid> and L</values>, and if L</valid> is
false also adds L</css> and L</errors>.
If L<JSON> serializer has C<convert_blesssed
rue value, then
this method is called automatically on object before serialization.
=cut
sub TO_JSON {
my $self = shift;
return +{
map { $_ => $self->$_ }
$self->valid ? (q
you wish to return this object as JSON then you must ensure
that you have configured the JSON serializer something like:
set engines => { serializer => { JSON => { convert_blessed => 1 } } };
my $params = params;
my $data = validator( $params, 'rules1' );
send_as JSON => $data;
};
=head1 CONFIGURATION
The following configuration settings are available (defau
a };
$meta;
}
# dzil also wants to get abstract for main module to put in dist's
# META.{yml,json}
sub before_build {
my $self = shift;
my $name = $self->zilla->name;
my $class = $n
}; use warnings; $^W=1;
use Symbol ();
use Jacode4e::RoundTrip; # pmake.bat makes META.yml, META.json and Makefile.PL by /^use /
#--------------------------------------------------------------------
ny::path(@_);
$class->new_from_json( $file->slurp_utf8 );
}
sub new_from_json {
my $class = shift;
my ($str) = @_;
require JSON::PP;
$class->new_from_hashref( JSON::PP->new->decode(ref $str ? $$
e JSON::PP;
require Types::XSD;
if ($self->has_separator) {
@values = map {
($_ eq '' || !defined) ? () : split quotemeta($self->separator)
} @values;
}
unless ($base =~ /^(string|json|x
ml|html|anyatomictype)^/) {
s/[\t\r\n]/ /g for @values;
}
unless ($base =~ /^(string|json|xml|html|anyatomictype|normalizedstring)^/) {
s/\s+/ /g for @values;
s/^\s+//g for @values;
s/\s+$
if ($obj and $base eq 'boolean') {
($c eq 'true' || $c eq '1') ? JSON::PP::true() :
($c eq 'false' || $c eq '0') ? JSON::PP::false() :
do { push @$errs, sprintf('Value %s is not a valid
X> or C<Spreadsheet::WriteExcel>.
L<Spreadsheet::Template> - used to generate spreadsheets from
"JSON files which describe the desired content and formatting".
By default it generates XLSX format.
L
of C<Spreadsheet::Write> which supports more output formats
(CSV, XLS, HTML, XHTML, XML, ODS, and JSON), but doesn't (appear to) support XLSX.
L<Spreadsheet::DataToExcel> - provides a simple OO inter
/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::JSON::MicrosoftDateFormat;
my $formatter=DateTime::Format::JSON::MicrosoftDateFormat->new;
my $dt=DateTime->now;
$dt->set_formatte
#!/usr/bin/perl
use strict;
use warnings;
use DateTime::Format::JSON::MicrosoftDateFormat;
my $parser=DateTime::Format::JSON::MicrosoftDateFormat->new;
my $dt=$parser->parse_datetime("/Date(13926065