defaults and return content.
The documentation for this module was mostly taken from the Zenoss JSON API docs. Keep in mind
that their (Zenoss Monitoring System) programming is based around python,
as I dont have all the information. What I've placed here is what I know
from reading the Zenoss JSON API documentation. In the event the method calls become clearer I will update this.
=head2 $obj
b definition
my $model = EntityModel->new->add_plugin(Web => {
})->load_from(JSON => {
file => $ENV{ENTITYMODEL_JSON_MODEL}
});
# Create the PSGI wrapper
my $app = EntityModel::Web::PSGI->new;
e JSON::PP;
$benchmarks{'JSON::PP'} = sub{JSON::PP::encode_json($structure)};
} or warn "Unable to require JSON::PP";
eval {
require JSON::XS;
$benchmarks{'JSON::XS'} = sub{JSON::XS::encode_json($
structure)};
} or warn "Unable to require JSON::XS";
eval {
require Convert::Bencode;
$benchmarks{'Convert::Bencode'} = sub{Convert::Bencode::bencode($structure)};
} or warn "Unable to require Conv
=> $self->name,
header => { reply_to => $self->bus->_rf_queue },
body => JSON::to_json($_)
) for @events;
};
sub DEMOLISH {}; after 'DEMOLISH' => sub {
my $self = shift;
{
# require JSON::PP;
# $benchmarks{'JSON::PP int'} = sub{JSON::PP::encode_json("9627")};
#} or warn "Unable to require JSON::PP";
eval {
require JSON::XS;
JSON::XS->import('encode_json');
my $arr
y = encode_json(["hello", 9627]);
my $bool = "[true]";
my $float = encode_json([3.14]);
my $hash = encode_json({"hello" => 9627});
my $int = encode_json([9627]);
my $null = encode_json([undef]);
ode_json(["hello"]);
$benchmarks{'JSON::XS int'} = sub {JSON::XS::decode_json($int)};
$benchmarks{'JSON::XS bool'} = sub {JSON::XS::decode_json($bool)};
$benchmarks{'JSON::XS float'} = sub {JSON::X
yMQ::Trait::AMQP;
use Moose::Role;
use File::ShareDir;
use AnyEvent;
use AnyEvent::RabbitMQ;
use JSON;
use Try::Tiny;
use Carp qw(croak carp);
has host => (is => "ro", isa => "Str");
has port => (is
er}->method_frame->routing_key;
try { $self->topics->{$topic}->AnyMQ::Topic::publish(JSON::from_json($payload)) }
catch { croak "failed to republsih on $topic: $_" };
};
}
sub new
finition
my $definition = {
defaults => {
history => JSON::false,
limit => JSON::null,
uid => '/zport/dmd'
}
};
# Check the ar
********************************
no Moose;
1;
__END__
=head1 NAME
Zenoss::Router::Service - A JSON/ExtDirect interface to operations on services
=head1 SYNOPSIS
use Zenoss;
my $api = Zen
defaults and return content.
The documentation for this module was mostly taken from the Zenoss JSON API docs. Keep in mind
that their (Zenoss Monitoring System) programming is based around python,
de qw( decode_utf8 );
use File::Temp;
use Graph::Easy;
use IPC::Run qw( run binary );
use JSON qw( decode_json );
use Module::Load;
use Text::CSV_XS;
use Text::TEI::Collate::Diff;
use Text::TEI::Colla
( $xml_file ) )
}
$aligner->align( @manuscripts );
# Read from a JSON input.
@manuscripts = $aligner->read_source( $JSON_string );
$aligner->align( @manuscripts );
=head1 DESCRIPTION
Te
ay title for the collation output results, should those
results need a display title (e.g. TEI or JSON output).
=item B<language> - Specify the language module we should use from those
available in T
ziness, $language ) = ( 25, 50, 'Default' );
my( $CSV, $storable, $outfile, $infile, $text, $cx, $json, $debug, %argspec );
GetOptions( 'csv' => \$CSV,
'width=i' => \$col_width,
'storable'
s' => \$outfile,
'store=s' => \$infile,
'text' => \$text,
'cx' => \$cx,
'json' => \$json,
'debug:i' => \$debug,
'argspec=s' => \%argspec,
'fuzziness=i' => \$fuzzines
', 'sliding' => 0, 'inclusive' => 0 );
}
## Get busy.
my( @files ) = @ARGV;
if( $json ) { # The 'file' is the JSON string.
my @lines;
while( <> ) {
push( @lines, $_ );
}
@files = (
parsed for
font-size-type, because you'd need curly brackets or something anyway, and this ain't JSON, it's just simple CSS-like parameter addressing.
=cut
sub parm_css {
my ($self, $parame
d_meta
Input: filename or dir or CPAN::Meta object
Output: CPAN::Meta object
Loads either META.json (preferred) or META.yml
=cut
sub load_meta {
my $base = shift || return;
return $base if UNI
}
map { -T and -r and CPAN::Meta->load_file($_) }
map { $base . "/$_"}
qw/ META.json META.yml /;
}
=pod
=head2 license_types
=cut
sub license_types {
qw/
AGPL_3 BSD
******************************
no Moose;
1;
__END__
=head1 NAME
Zenoss::Router::Messaging - A JSON/ExtDirect interface to operations on messages
=head1 SYNOPSIS
use Zenoss;
my $api = Zen
defaults and return content.
The documentation for this module was mostly taken from the Zenoss JSON API docs. Keep in mind
that their (Zenoss Monitoring System) programming is based around python,
ition = {
required => ['uid'],
defaults => {
useFieldSets => JSON::true,
}
};
# Check the args
$self->_check_args($args, $definition);
#
************************************
no Moose;
1;
__END__
=head1 NAME
Zenoss::Router::Mib - A JSON/ExtDirect interface to operations on MIBs
=head1 SYNOPSIS
use Zenoss;
my $api = Zenoss-
defaults and return content.
The documentation for this module was mostly taken from the Zenoss JSON API docs. Keep in mind
that their (Zenoss Monitoring System) programming is based around python,
ot::BasicBot::Pluggable::Module::GitHub;
use base 'Bot::BasicBot::Pluggable::Module::GitHub';
use JSON;
our $VERSION = 0.02;
sub help {
return <<HELPMSG;
Announce new/changed issues and pull re
hes.
HELPMSG
}
sub tick {
my $self = shift;
my $issue_state_file = 'last-issues-state.json';
my $seconds_between_checks = $self->get('poll_issues_interval') || 60 * 5;
return
Failed to open $issue_state_file - $!";
my $json;
{ local $/; $json = <$fh> }
close $fh;
my $seen_issues = $json ? JSON::from_json($json) : {};
# OK, for each channel, pull detai
::Bitly;
use warnings;
use strict;
use Carp;
use base qw( WWW::Shorten::generic Exporter );
use JSON::Any;
require XML::Simple;
require Exporter;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
our @EXP
ing each shortened
WWW::Shorten::Bitly uses XML::Simple to convert the xml response and JSON::Any to convert JSON responses for the meta info and click stats to create a hashref of the results.
WWW::
$bitly->{BASE} = BASE_JMP;
} else {
$bitly->{BASE} = BASE_BLY;
}
$bitly->{json} = JSON::Any->new;
$bitly->{browser} = LWP::UserAgent->new(agent => $args{source});
$bitly->{
ble::Module::GitHub;
use base 'Bot::BasicBot::Pluggable::Module::GitHub';
use LWP::Simple ();
use JSON;
sub help {
return <<HELPMSG;
Monitors outstanding pull requests on a GitHub project.
Allow
http://github.com/api/v2/json/pulls/" . $project;
my $json = LWP::Simple::get($url)
or return "Unknown - error fetching $url";
my $pulls = JSON::from_json($json)
or return "Unk
me API methods
my $response = $api->device_getDevices();
# Print the JSON return
print $response->json;
=head1 DESCRIPTION
This module creates a connection to the Zenoss API, and te
our $VERSION = '0.10';
use 5.012004;
use Data::Dumper;
use common::sense;
use LWP::Simple;
use JSON;
use HTTP::Cookies;
use LWP::UserAgent;
my $base_url = 'http://www.reddit.com/';
my $api
l = $api_url . 'submit';
my $comment_url = $api_url . 'comment';
my $api_type = 'json';
sub new {
my $obj_class = shift;
my $class = ref $obj_class || $obj_class;
= shift;
my $response = shift;
my $decoded = from_json ($response->content);
$self->modhash ($decoded->{json}{data}{modhash});
}
# takes link, returns post ID
sub parse_link {
ckage Directory;
use 5.008;
use strict;
use warnings 'all';
use parent 'CGI::Application';
use JSON 2.00; # The API was changed
use Try::Tiny;
use WWW::USF::Directory;
sub setup {
my ($self) = @_
ults and response
my (@results, $response);
# Set the header to specity JSON
$self->header_add(-type => 'application/json');
try {
# Search the directory
@results = $self->{directory}->searc
he JSON-encoded results to print
$response = JSON->new->encode({
results => \@results,
});
}
catch {
# Get the error
my $error = $_;
# Return a JSON with the error
$response = JSON->
*************************************************
# Name: Template.pm
#
# Description: A JSON/ExtDirect interface to operations on templates
#
# Author: Patrick Baker
#
# Version:
# Argument definition
my $definition = {
defaults => {
query => JSON::null,
}
};
# Check the args
$self->_check_args($args, $definition);
#
# Argument definition
my $definition = {
defaults => {
query => JSON::null,
},
required => ['uid'],
};
# Check the args
$self->_check_