306741546438020584b9
my $tryStream = "https://opml.radiotime.com/Tune.ashx?id=$stationID&render=json";
print STDERR "-2 (we're a station) FETCHING URL=$tryStream=\n" if ($DEBUG);
my $response =
#STEP 1 FAILED, INVALID PODCAST URL, PUNT!
if ($html =~ m#\<script\s+type\=\"application\/ld\+json"\>(.+?)\<\/script\>#s) {
my $epidata = $1;
if ($epidata =~ m#\"associatedMedia\"\:\{([^\}]+
ined($embedded_video) && $embedded_video->count() > 0);
##NEXT, TRY FOR YOUTUBE URLs HIDDEN IN JSON:
while ($html && $html =~ s#\"url\"\:\"([^\"]+)\"\,##so) {
my $one = $1;
my $embeddedU
unless ($self->{'notrim'});
$url2fetch = $embeddedURL;
print STDERR "--embedded YOUTUBE JSON url=$url2fetch=\n" if ($DEBUG);
$self->{'_isaYtPage'} = 1;
$self->{'id'} = $1 if ($url2
my $json = $opt{json};
my $strpdate = $opt{strpdate_obj};
my $strptime = $opt{strptime_obj};
my $ref = {
id => $opt{id},
day => $strpdate->parse_datetime( $json->{rei
$json->{zugName},
is_cancelled => $json->{cancelled},
raw_route => $json->{halte},
raw_polyline => $json->{polylineGroup}{polylineDescriptions},
strptime_obj => $strptime,
};
if ( $json-
>{halte} and @{ $json->{halte} } ) {
my %admin_id_ml;
my %trip_no_ml;
for my $stop ( @{ $json->{halte} } ) {
if ( defined $stop->{adminID} ) {
$admin_id_ml{ $stop->{adminID} } += 1;
}
RACT: Simple Class to post status to BlueSky.
use LWP::UserAgent;
use DateTime;
use JSON qw(encode_json decode_json);
use URI;
use Encode qw(decode_utf8);
use File::Type;
use File::Basename;
use nam
>request($blob_req);
return unless $blob_response->is_success;
my $blob_content = decode_json($blob_response->decoded_content);
($card->{thumb}) = $blob_content->{blob};
}
return $ca
y $response = $self->{ua}->get($uri);
return if !$response->is_success;
my $content = decode_json($response->decoded_content);
return $content->{did};
}
sub _generate_facets {
my $self = shi
pfile);
use List::Util qw(max);
use POSIX qw(strftime);
use Pod::Usage;
use Term::ANSIColor;
use JSON;
use WWW::Noss::Curl qw(curl curl_error http_status_string);
use WWW::Noss::DB;
use WWW::Noss::F
$/ = undef; readline $fh };
close $fh;
my $json_obj = JSON->new->relaxed;
my $json = $json_obj->decode($slurp);
unless (ref $json eq 'HASH') {
die "$self->{ ConfFile } is no
id $PRGNAM configuration file\n";
}
if (defined $json->{ feeds }) {
if (not ref $json->{ feeds }) {
my $p = $json->{ feeds } =~ s/^~/@{[ home ]}/r;
$self->{ Fe
ings;
our $VERSION = '2.00';
use List::Util qw(all any max none);
use DBD::SQLite;
use DBI;
use JSON;
use WWW::Noss::FeedReader qw(read_feed);
use WWW::Noss::Util qw(resolve_url);
my %DAY_MAP = (
encode_json($feedref->{ category }) : undef),
$feedref->{ generator },
$feedref->{ image },
$feedref->{ rights },
(defined $feedref->{ skiphours } ? encode_json($feedr
ef->{ skiphours }) : undef),
(defined $feedref->{ skipdays } ? encode_json($feedref->{ skipdays }) : undef),
);
my $upsert_post = $self->{ DB }->prepare(
q{
INSERT INTO post
ication. It is
responsible for publishing the deduplicated entries to a specified format
(Atom or JSON).
=head1 SYNOPSIS
use App::FeedDeduplicator::Publisher;
my $publisher = App::FeedDedup
App::FeedDeduplicator::Publisher. The constructor
accepts an arrau of entries, a format (Atom or JSON), and a maximum number of
entries as parameters.
The entries should be an array reference contai
hould contain a hash reference with the feed information.
The format should be either 'Atom' or 'JSON', and the maximum number of
entries specifies how many entries to include in the output.
=head2
xml2perl
perl2xml
json2perl
perl2json
);
our %EXPORT_TAGS = (
JSON;
}
sub xml2perl
{
my $ob = new XML::Bare( text => shift() );
return $ob->parse();
}
sub perl2xml
{
return XML::Bare::obj2xml( shift() );
}
sub json2perl
{
return JSON
::decode_json( shift );
}
sub perl2json
{
return JSON::encode_json( shift );
}
##############################################################################
=pod
=head1 NAME
Data::Tools::Se
can output the deduplicated feed in either Atom or JSON format.
It is designed to be run from the command line, and it can be configured using
a JSON configuration file. The configuration file should
s
and functionality to be added in the future.
=head1 CONFIGURATION
The configuration file is a JSON file that specifies the feeds to be
aggregated, the output format, and the maximum number of entr
he output.
By default, the configuration file should be located at
C<~/.feed-deduplicator/config.json>, but this can be overridden by setting
the C<FEED_DEDUP_CONFIG> environment variable.
The confi
MARC::Validator::Report;
use strict;
use warnings;
use Class::Utils qw(set_params);
use Cpanel::JSON::XS;
use Getopt::Std;
use Perl6::Slurp qw(slurp);
our $VERSION = 0.03;
# Constructor.
sub new {
s_report {
my ($self, $report_file) = @_;
my $report = slurp($report_file);
# JSON output.
my $j = Cpanel::JSON::XS->new;
$self->{'_report'} = $j->decode($report);
$self->{'_list'} = {};
for
sage {
my $self = shift;
print STDERR "Usage: $0 [-h] [-l] [-p plugin] [-v] [--version] report.json\n";
print STDERR "\t-h\t\tPrint help.\n";
print STDERR "\t-l\t\tList unique errors.\n";
print
utodie qw(:all);
use JSON::MaybeXS;
use File::Glob ':glob';
use File::Slurp;
use File::stat;
use POSIX qw(strftime);
use Readonly;
Readonly my $cover_db => 'cover_db/cover.json';
Readonly my $output
its in the coverage trend graph
# Read and decode coverage data
my $json_text = read_file($cover_db);
my $data = decode_json($json_text);
my $coverage_pct = 0;
my $badge_color = 'red';
if(my $total
} bsd_glob("coverage_history/*.json");
my $prev_data;
if (@history >= 1) {
my $prev_file = $history[-1]; # Most recent before current
eval {
$prev_data = decode_json(read_file($prev_file));
};
}
o::ADS::QTree;
use Astro::ADS::Result;
sub parse_response {
my ($self, $json) = @_;
unless ($json && exists $json->{responseHeader}) {
warn 'No response to parse';
return;
ws fl> } = @{$json->{responseHeader}{params}}{ qw<q rows fl> };
$result_params->{status} = @{$json->{responseHeader}}{ status };
@{$result_params}{ qw<numFound start> } = @{$json->{response}}{
numFound start> };
$result_params->{numFoundExact} = $json->{response}{numFoundExact} ? 1 : 0;
my @papers;
for my $paper ( @{$json->{response}->{docs}} ) {
push @papers, Astro::AD
trings (major.minor.patch)
=item * C<jwt> - JWT-like tokens (base64url format)
=item * C<json> - Simple JSON objects
=item * C<base64> - Base64-encoded strings
=item * C<md5> - MD5 hashes (32 hex
$payload.$signature";
}
},
description => 'JWT-like tokens (base64url format)',
},
json => {
code => q{
Gen {
my @keys = qw(id name value status count);
my $key = $keys
my $value = 1 + int(rand(1000));
qq({"$key":$value});
}
},
description => 'Simple JSON objects',
},
base64 => {
code => q{
Gen {
my @chars = ('A'..'Z', 'a'..'z', '0'..
d2 Script-based tooling
Available in 0.1.8, basic C<schedule-activity.pl> script supports Dumper/JSON schedules and activity lists, compiling with/out safety checks. Future support may provide for c
package DBD::libsql::Hrana;
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
use JSON;
use Protocol::WebSocket;
use IO::Socket::SSL;
use Carp;
our $VERSION = "0.05";
# Hrana Protocol
t => $options{timeout} || 30,
agent => "DBD::libsql/$VERSION",
),
json => JSON->new->utf8,
connection_id => undef,
closed => 0,
}, $class;
# De
=> 'application/json');
if ($self->{auth_token}) {
$request->header('Authorization' => 'Bearer ' . $self->{auth_token});
}
$request->content($self->{json}->encode({
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(:all);
use JSON::MaybeXS;
use File::Glob ':glob';
use File::Slurp;
use File::stat;
use POSIX qw(strftime);
use Readonly;
Readonly my %co
r_db => 'cover_db/cover.json',
output => 'cover_html/index.html'
);
# Read and decode coverage data
my $json_text = read_file($config{cover_db});
my $data = decode_json($json_text);
my $coverage_pc
ob("coverage_history/*.json");
# Cache historical data instead of reading for each file
my %historical_cache;
for my $hist_file (@history_files) {
my $json = eval { decode_json(read_file($hist_file)
ases
use 5.018;
use strict;
use warnings;
use DBI ();
use LWP::UserAgent;
use HTTP::Request;
use JSON;
use Data::Dumper;
our $VERSION = '0.05';
our $drh;
# Global hash to store HTTP clients keyed b
# Convert to string representation
$HTTP_CLIENTS{$dbh_id} = {
ua => $ua,
json => JSON->new->utf8,
base_url => $server_url,
auth_token => $auth_token,
baton
('POST', "$server_url/v2/pipeline");
$init_request->header('Content-Type' => 'application/json');
# Add Turso authentication header if token is available
if ($auth_tok
adRevolutionaryDate::MsgMaker';
use DateTime;
use File::ShareDir ':ALL';
use LWP::UserAgent;
use JSON;
use Locale::TextDomain 'App-SpreadRevolutionaryDate';
use namespace::autoclean;
has 'api_key'
->{tools} = [
{
google_search => {},
},
];
}
my $json = JSON->new->utf8;
my $args_json = $json->encode($payload);
my $ua = LWP::UserAgent->new(env_proxy => 1, timeout
ader('Accept' => 'application/json');
$ua->default_header('Content-Type' => 'application/json');
my $req = HTTP::Request->new('POST', $url);
$req->content($args_json);
my $resp = $ua->request(
urn Astro::ADS::Result->new( {error => $error_obj} );
}
my $json = $response->json;
return $self->parse_response( $json );
}
sub query_tree {
my ($self, $terms) = @_;
my $url =
my $response = $self->post_response( $url, $bibcode_list );
my $json = $response->json;
return $self->parse_response( $json );
}
sub gather_search_terms {
my ($self, $terms) = @_;
m