view release on metacpan or search on metacpan
my %my_addresses;
# Allowed route destination networks
my $net_44_regexp = '^44\.';
# We do not accept routes less specific than /15
my $minimum_prefix_len = 15;
# tcp window to set
my $tcp_window = 840;
# time (in seconds) to use routes which are no longer advertised
# - this is set to a large value, so that if the rip advertisements
# from mirrorshades stop, the network won't go down right away.
my $route_ttl = 7*24*60*60;
my %current_routes;
warn "route $rkey has expired, deleting\n" if ($verbose);
route_delete($rkey);
delete $current_routes{$rkey};
} elsif ($current_routes{$rkey}->{'t'} > $now) {
# clock has jumped backwards, the time is in
# the future - set 't' to $now so that the route
# will be expired eventually
$current_routes{$rkey}->{'t'} = $now;
}
}
}
}
fill_local_ifs();
# Enable multicast on the tunnel interface, the flag is
# not set by default
system($ifconfig, $tunnel_if, 'multicast') == 0 or die "ifconfig $tunnel_if multicast failed: $?\n";
# Create the UDP multicast socket to receive RIP broadcasts
warn "opening UDP socket...\n" if ($verbose);
my $socket = IO::Socket::Multicast->new(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AMQP.pm view on Meta::CPAN
=head1 METHODS
B<server($url)>
Configures all of the connection settings based on an AMQP url. The format of which is:
amqp://username:password@host:port/vhost
All of the elements of the url are required if you are not using the defaults. The default settings are:
amqp://guest:guest@localhost:5672/
=head1 TODO
view all matches for this distribution
view release on metacpan or search on metacpan
examples/boxes.pl view on Meta::CPAN
my @white = (
(map { [1,$_], [$x,$_] } (1..$y)),
(map { [$_, 1], [$_, $y] } (1..$x)),
);
for my $c (@white) {
$map->set(@$c, 100);
}
print "$x x $y\n";
print $map, "\n";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ANSI/Palette.pm view on Meta::CPAN
use warnings;
our $VERSION = '0.05';
use base 'Import::Export';
our %EX = (
reset => [qw/all/],
palette_8 => [qw/all/],
palette_16 => [qw/all/],
palette_256 => [qw/all/],
text_8 => [qw/all text ansi_8/],
text_16 => [qw/all text ansi_16/],
lib/ANSI/Palette.pm view on Meta::CPAN
sub palette_8 {
print "ANSI palette -> \\e[Nm\n";
for (30..37) {
print "\e[" . $_ . "m " . $_;
}
reset;
}
sub palette_16 {
print "ANSI palette -> \\e[Nm\n";
for (30..37) {
lib/ANSI/Palette.pm view on Meta::CPAN
}
print "\nANSI palette -> \\e[N;1m\n";
for (30..37) {
print "\e[" . $_ . ";1m " . $_;
}
reset;
}
sub palette_256 {
print "ANSI palette -> \\e[38;5;Nm\n";
for my $i (0..15) {
lib/ANSI/Palette.pm view on Meta::CPAN
my $code = $i * 16 + $j;
print "\e[38;5;" . $code . "m " . $code;
}
print "\n";
}
reset;
}
sub text_8 {
print "\e[" . $_[0] . "m" . $_[1];
reset();
}
sub text_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : "") . "m" . $_[2];
reset();
}
sub text_256 {
print "\e[38;5;" . $_[0] . "m" . $_[1];
reset();
}
sub bold_8 {
print "\e[" . $_[0] . ";1m" . $_[1];
reset();
}
sub bold_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : ";0") . ";1m" . $_[2];
reset();
}
sub bold_256 {
print "\e[38;5;" . $_[0] . ";1m" . $_[1];
reset();
}
sub underline_8 {
print "\e[" . $_[0] . ";4m" . $_[1];
reset();
}
sub underline_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : "") . ";4m" . $_[2];
reset();
}
sub underline_256 {
print "\e[38;5;" . $_[0] . ";4m" . $_[1];
reset();
}
sub italic_8 {
print "\e[" . $_[0] . ";3m" . $_[1];
reset();
}
sub italic_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : "") . ";3m" . $_[2];
reset();
}
sub italic_256 {
print "\e[38;5;" . $_[0] . ";3m" . $_[1];
reset();
}
sub background_text_8 {
print "\e[" . $_[0] . ";" . $_[1] . "m" . $_[2];
reset();
}
sub background_text_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : ";0") . ";" . $_[2] . "m" . $_[3];
reset();
}
sub background_text_256 {
print "\e[48;5;" . $_[0] . ";38;5;" . $_[1] . "m" . $_[2];
reset();
}
sub background_bold_8 {
print "\e[" . $_[0] . ";" . $_[1] . ";1m" . $_[2];
reset();
}
sub background_bold_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : ";0") . ";" . $_[2] . ";1m" . $_[3];
reset();
}
sub background_bold_256 {
print "\e[48;5;" . $_[0] . ";38;5;" . $_[1] . ";1m" . $_[2];
reset();
}
sub background_underline_8 {
print "\e[" . $_[0] . ";" . $_[1] . ";4m" . $_[2];
reset();
}
sub background_underline_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : ";0") . ';' . $_[2] . ";4m" . $_[3];
reset();
}
sub background_underline_256 {
print "\e[48;5;" . $_[0] . ";38;5;" . $_[1] . ";4m" . $_[2];
reset();
}
sub background_italic_8 {
print "\e[" . $_[0] . ";" . $_[1] . ";3m" . $_[2];
reset();
}
sub background_italic_16 {
print "\e[" . $_[0] . ($_[1] ? ";1" : ";0") . ";" . $_[2] . ";3m" . $_[3];
reset();
}
sub background_italic_256 {
print "\e[48;5;" . $_[0] . ";38;5;" . $_[1] . ";3m" . $_[2];
reset();
}
sub reset { print "\e[0m"; }
__END__
1;
lib/ANSI/Palette.pm view on Meta::CPAN
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head2 reset
=cut
=head2 palette_8
view all matches for this distribution
view release on metacpan or search on metacpan
#CORE::close($self->{fd});
return;
}
sub set_debug {
my ($self, $level) = @_;
$self->{debug_level} = $level;
print "slfap debug level $level\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AOLserver/CtrlPort.pm view on Meta::CPAN
output.
It is useful for creating test suites for AOLserver applications which
can be controlled via the control port.
To configure AOLserver's control port, use settings similar to the following
ones:
ns_section "ns/server/${servername}/module/nscp"
ns_param address myhostname
ns_param port 3334
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Basecamp.pm view on Meta::CPAN
=head2 account
$basecamp->account;
$basecamp->account('ACCOUNT');
The account attribute should be set to the account holder's account ID number.
=head2 identifier
$basecamp->identifier;
$basecamp->identifier('IDENTIFIER');
The identifier attribute should be set to a string that identifies your application.
=head2 password
$basecamp->password;
$basecamp->password('PASSWORD');
The password attribute should be set to the account holder's password.
=head2 username
$basecamp->username;
$basecamp->username('USERNAME');
The username attribute should be set to the account holder's username.
=head2 debug
$basecamp->debug;
$basecamp->debug(1);
lib/API/Basecamp.pm view on Meta::CPAN
=head2 url
$basecamp->url;
$basecamp->url(Mojo::URL->new('https://basecamp.com'));
The url attribute set the base/pre-configured URL object that will be used in
all HTTP requests. This attribute expects a L<Mojo::URL> object.
=head2 user_agent
$basecamp->user_agent;
$basecamp->user_agent(Mojo::UserAgent->new);
The user_agent attribute set the pre-configured UserAgent object that will be
used in all HTTP requests. This attribute expects a L<Mojo::UserAgent> object.
=head1 METHODS
=head2 action
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/BigBlueButton/Requests.pm view on Meta::CPAN
return $self->abstract_request( $data );
}
=item B<getrecordings($self,%params)>
Retrieves the recordings that are available for playback for a given meetingID (or set of meeting IDs).
%params:
meetingID
lib/API/BigBlueButton/Requests.pm view on Meta::CPAN
return $self->abstract_request( $data );
}
=item B<publishrecordings($self,%params)>
Publish and unpublish recordings for a given recordID (or set of record IDs).
%params:
recordID
This parameter is mandatory.
A record ID for specify the recordings to apply the publish action.
It can be a set of record IDs separated by commas.
publish
This parameter is mandatory.
The value for publish or unpublish the recording(s). Available values: true or false.
lib/API/BigBlueButton/Requests.pm view on Meta::CPAN
return $self->abstract_request( $data );
}
=item B<deleterecordings($self,%params)>
Delete one or more recordings for a given recordID (or set of record IDs).
%params:
recordID
This parameter is mandatory.
A record ID for specify the recordings to delete.
It can be a set of record IDs separated by commas.
=cut
sub deleterecordings {
my ( $self, %params ) = @_;
lib/API/BigBlueButton/Requests.pm view on Meta::CPAN
my $data = $self->_generate_data( 'getDefaultConfigXML' );
return $self->abstract_request( $data );
}
=item B<setconfigxml($self,%params)>
Associate an custom config.xml file with the current session.
%params:
lib/API/BigBlueButton/Requests.pm view on Meta::CPAN
configXML
This parameter is mandatory.
A valid config.xml file
SEE MORE L<https://code.google.com/p/bigbluebutton/wiki/API#setConfigXML>
=cut
sub setconfigxml {
my ( $self, %params ) = @_;
my $data = $self->_generate_data( 'setConfigXML', \%params );
return $self->abstract_request( $data );
}
=item B<generate_checksum($self,$request,$params)>
view all matches for this distribution
view release on metacpan or search on metacpan
examples/bash/githubcl.bash view on Meta::CPAN
__githubcl_handle_options_flags
case $INDEX in
1)
__comp_current_options || return
__githubcl_dynamic_comp 'commands' '/gists/:id'$'\t''Delete a gist.'$'\n''/gists/:id/comments/:commentId'$'\t''Delete a comment.'$'\n''/gists/:id/star'$'\t''Unstar a gist.'$'\n''/notifications/threads/:id/subscription'$'\t''Delete a Threa...
;;
*)
# subcmds
case ${MYWORDS[1]} in
examples/bash/githubcl.bash view on Meta::CPAN
esac
;;
esac
;;
/repos/:owner/:repo/releases/assets/:id)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
case $INDEX in
2)
examples/bash/githubcl.bash view on Meta::CPAN
__githubcl_handle_options_flags
case $INDEX in
1)
__comp_current_options || return
__githubcl_dynamic_comp 'commands' '/emojis'$'\t''Lists all the emojis available to use on GitHub....'$'\n''/events'$'\t''List public events.'$'\n''/feeds'$'\t''List Feeds.'$'\n''/gists'$'\t''List the authenticated user'"'"'s gists or if ...
;;
*)
# subcmds
case ${MYWORDS[1]} in
examples/bash/githubcl.bash view on Meta::CPAN
esac
;;
esac
;;
/repos/:owner/:repo/releases/:id/assets)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
case $INDEX in
2)
examples/bash/githubcl.bash view on Meta::CPAN
esac
;;
esac
;;
/repos/:owner/:repo/releases/assets/:id)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
case $INDEX in
2)
examples/bash/githubcl.bash view on Meta::CPAN
__githubcl_handle_options_flags
case $INDEX in
1)
__comp_current_options || return
__githubcl_dynamic_comp 'commands' '/gists/:id'$'\t''Edit a gist.'$'\n''/gists/:id/comments/:commentId'$'\t''Edit a comment.'$'\n''/notifications/threads/:id'$'\t''Mark a thread as read'$'\n''/orgs/:org'$'\t''Edit an Organization.'$'\n''/...
;;
*)
# subcmds
case ${MYWORDS[1]} in
examples/bash/githubcl.bash view on Meta::CPAN
esac
;;
esac
;;
/repos/:owner/:repo/releases/assets/:id)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
case $INDEX in
2)
examples/bash/githubcl.bash view on Meta::CPAN
__githubcl_handle_options_flags
case $INDEX in
2)
__comp_current_options || return
__githubcl_dynamic_comp 'commands' '/gists/:id'$'\n''/gists/:id/comments/:commentId'$'\n''/gists/:id/star'$'\n''/notifications/threads/:id/subscription'$'\n''/orgs/:org/members/:username'$'\n''/orgs/:org/public_members/:username'$'\n'...
;;
*)
# subcmds
case ${MYWORDS[2]} in
examples/bash/githubcl.bash view on Meta::CPAN
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
/repos/:owner/:repo/releases/assets/:id)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
examples/bash/githubcl.bash view on Meta::CPAN
__githubcl_handle_options_flags
case $INDEX in
2)
__comp_current_options || return
__githubcl_dynamic_comp 'commands' '/emojis'$'\n''/events'$'\n''/feeds'$'\n''/gists'$'\n''/gists/:id'$'\n''/gists/:id/comments'$'\n''/gists/:id/comments/:commentId'$'\n''/gists/:id/star'$'\n''/gists/public'$'\n''/gists/starred'$'\n''/...
;;
*)
# subcmds
case ${MYWORDS[2]} in
examples/bash/githubcl.bash view on Meta::CPAN
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
/repos/:owner/:repo/releases/:id/assets)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
/repos/:owner/:repo/releases/assets/:id)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
examples/bash/githubcl.bash view on Meta::CPAN
__githubcl_handle_options_flags
case $INDEX in
2)
__comp_current_options || return
__githubcl_dynamic_comp 'commands' '/gists/:id'$'\n''/gists/:id/comments/:commentId'$'\n''/notifications/threads/:id'$'\n''/orgs/:org'$'\n''/repos/:owner/:repo'$'\n''/repos/:owner/:repo/comments/:commentId'$'\n''/repos/:owner/:repo/gi...
;;
*)
# subcmds
case ${MYWORDS[2]} in
examples/bash/githubcl.bash view on Meta::CPAN
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
/repos/:owner/:repo/releases/assets/:id)
FLAGS+=()
OPTIONS+=()
__githubcl_handle_options_flags
__comp_current_options true || return # no subcmds, no params/opts
;;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/CPanel/Domain.pm view on Meta::CPAN
sub change_site_ip {
my $params = shift;
return API::CPanel::action_abstract(
params => $params,
func => 'setsiteip',
container => 'result',
allowed_fields => 'ip user domain',
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Client.pm view on Meta::CPAN
return $self->dispatch(%args, method => 'put');
}
method prepare(Object $ua, Object $tx, Any %args) {
$self->set_auth($ua, $tx, %args);
$self->set_headers($ua, $tx, %args);
$self->set_identity($ua, $tx, %args);
return $self;
}
method process(Object $ua, Object $tx, Any %args) {
lib/API/Client.pm view on Meta::CPAN
timeout => $self->timeout,
url => $self->url->to_string,
};
}
method set_auth($ua, $tx, %args) {
if ($self->can('auth')) {
$tx->req->url->userinfo(join ':', @{$self->auth});
}
return $self;
}
method set_headers($ua, $tx, %args) {
if ($self->can('headers')) {
$tx->req->headers->header(@$_) for @{$self->headers};
} else {
$tx->req->headers->header('Content-Type' => 'application/json');
}
return $self;
}
method set_identity($ua, $tx, %args) {
$tx->req->headers->header('User-Agent' => $self->name);
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/DeutscheBahn/Fahrplan.pm view on Meta::CPAN
my $value = $args{$_};
croak sprintf 'Missing path parameter: %s', $_ unless $value;
$path .= "/${value}";
}
# set the uri path including the path set in the base url
$uri->path( $uri->path . $path );
# add query parameters
for my $param ( keys %{ $definition->{query_parameters} } ) {
if ( my $value = $args{$param} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/DirectAdmin.pm view on Meta::CPAN
my $packages = $da->user->show_packages();
=item show_user_config
Return all user settings.
Example:
my $user_config = $da->user->show_user_config({ user => 'username' });
view all matches for this distribution
view release on metacpan or search on metacpan
bin/drip_client.pl view on Meta::CPAN
Specify the location of a configuration file. Otherwise, defaults to location
specified in the DRIP_CLIENT_CONF environment variable or ~/.drip.conf. Data
in the configuration file must be encoded in YAML format. See
L<API::Drip::Request/"CONFIGURATION"> for the specific data that may be stored.
Each configuration item may also be overriden by setting an environment
variable with the same name.
=back
=head2 Operations
view all matches for this distribution
view release on metacpan or search on metacpan
examples/edw/Rest.pl view on Meta::CPAN
"query=s" => \$query,
"help|?" => \$help
);
Pod::Usage::pod2usage(1) if ( $help );
my %h_setup = (
grid => $grid,
ip => $ip,
token => $token,
site => $site,
query => $query
);
# get local IP
if ( !defined $h_setup{ip} || !length $h_setup{ip} ) {
my $response = HTTP::Tiny->new->get('http://monip.org/');
unless ( $response->{success} ) {
print STDERR "\tunable to reach external network to get IP address.\n";
exit(1);
}
($h_setup{ip}) = ($response->{content} =~ /IP\s:\s(\d+\.\d+\.\d+\.\d+)/gm);
}
foreach my $p ( qw/ grid ip token site query / ) {
if ( !defined $h_setup{$p} || !length $h_setup{$p} ) {
print STDERR "\tmissing $p parameter, check help.\n";
exit(1);
}
}
delete $h_setup{$_} for ( qw/ site query / );
# get query to send
my $qfile = './examples/edw/sql/'.$query.'.sql';
if ( !-e $qfile ) {
print STDERR "\trequested query $query does not exists.\n";
examples/edw/Rest.pl view on Meta::CPAN
#
# Create a user specific Hook used to handle Analysis replies.
#
$h_setup{hook} = new API::Eulerian::EDW::Hook::Print();
my $peer = new API::Eulerian::EDW::Peer::Rest(\%h_setup);
my $status = $peer->request( $cmd );
if ( $status->error() ) {
$status->dump();
exit(1);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Facebook.pm view on Meta::CPAN
=head2 access_token
$facebook->access_token;
$facebook->access_token('ACCESS_TOKEN');
The access_token attribute should be set to an API access token associated with
your account.
=head2 identifier
$facebook->identifier;
$facebook->identifier('IDENTIFIER');
The identifier attribute should be set to a string that identifies your app.
=head2 debug
$facebook->debug;
$facebook->debug(1);
lib/API/Facebook.pm view on Meta::CPAN
=head2 url
$facebook->url;
$facebook->url(Mojo::URL->new('https://graph.facebook.com'));
The url attribute set the base/pre-configured URL object that will be used in
all HTTP requests. This attribute expects a L<Mojo::URL> object.
=head2 user_agent
$facebook->user_agent;
$facebook->user_agent(Mojo::UserAgent->new);
The user_agent attribute set the pre-configured UserAgent object that will be
used in all HTTP requests. This attribute expects a L<Mojo::UserAgent> object.
=head1 METHODS
=head2 action
lib/API/Facebook.pm view on Meta::CPAN
The product_item resource returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://developers.facebook.com/docs/graph-api/reference/product-item>.
=head2 product_set
$facebook->resource(param('product-set'));
The product_set resource returns a new instance representative of the API
resource requested. This method accepts a list of path segments which will be
used in the HTTP request. The following documentation can be used to find more
information. L<https://developers.facebook.com/docs/graph-api/reference/product-set>.
=head2 promotion_info
$facebook->resource(param('promotion-info'));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/GitForge.pm view on Meta::CPAN
=head2 forge_access_token $domain
Return access token for forge at C<$domain>, assumed to be stored
under C<$ENV{XDG_CONFIG_HOME}/gitforge/access_tokens/$domain> where
the environment variable defaults to C<~/.config> if unset.
=head2 remote_forge_info $remote
Look at the URL for git remote C<$remote>, as returned by C<git remote
get-url>, assume that this remote is a git forge, and return the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Github.pm view on Meta::CPAN
=head2 identifier
$github->identifier;
$github->identifier('IDENTIFIER');
The identifier attribute should be set to a string that identifies your
application.
=head2 token
$github->token;
$github->token('TOKEN');
The token attribute should be set to the API user's personal access token.
=head2 username
$github->username;
$github->username('USERNAME');
The username attribute should be set to the API user's username.
=head2 debug
$github->debug;
$github->debug(1);
lib/API/Github.pm view on Meta::CPAN
=head2 url
$github->url;
$github->url(Mojo::URL->new('https://api.github.com'));
The url attribute set the base/pre-configured URL object that will be used in
all HTTP requests. This attribute expects a L<Mojo::URL> object.
=head2 user_agent
$github->user_agent;
$github->user_agent(Mojo::UserAgent->new);
The user_agent attribute set the pre-configured UserAgent object that will be
used in all HTTP requests. This attribute expects a L<Mojo::UserAgent> object.
=head1 METHODS
=head2 action
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Google.pm view on Meta::CPAN
warn "New tokens got" if $self->{debug};
my $res = {};
$res->{old} = $self->get_access_token_from_storage($user);
warn Dumper $tokens if $self->{debug};
if ($tokens->{access_token}) {
$self->set_access_token_to_storage($user, $tokens->{access_token});
}
$res->{new} = $self->get_access_token_from_storage($user);
return $res;
};
lib/API/Google.pm view on Meta::CPAN
sub get_access_token_from_storage {
my ($self, $user) = @_;
$self->{tokensfile}->get('gapi/tokens/'.$user.'/access_token');
};
sub set_access_token_to_storage {
my ($self, $user, $token) = @_;
$self->{tokensfile}->set('gapi/tokens/'.$user.'/access_token', $token);
};
sub build_headers {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Handle.pm view on Meta::CPAN
);
sub BUILD {
my $self = shift;
# Initialize attributes like 'uri' that may be set
# in the configuration YAML.
for my $attr ( keys %{ $self->config } ) {
$self->$attr( $self->config->{ $attr } )
if $self->can( $attr );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/INSEE/Sirene.pm view on Meta::CPAN
debug_mode => 0,
current_endpoint => undef,
}, $class;
$self->_initUserAgent();
$self->setProxy($proxy);
$self->setMaxResults($max_results);
$self->setTimeout($timeout);
return $self;
}
sub setCredentials {
my ($self, $credentials) = @_;
$self->{'credentials'} = $credentials;
}
sub setMaxResults {
my ($self, $max_results) = @_;
$max_results //= DEFAULT_MAX_RESULTS;
$self->{'max_results'} = $max_results > HARD_MAX_RESULTS ? HARD_MAX_RESULTS : $max_results;
}
sub setDebugMode {
my ($self, $debug_value) = @_;
$self->{'debug_mode'} = $debug_value;
}
sub setProxy {
my ($self, $proxy) = @_;
defined $proxy ? $self->{'user_agent'}->proxy([ 'http', 'https' ], $proxy) : $self->{'user_agent'}->env_proxy;
}
sub setTimeout {
my ($self, $timeout) = @_;
$timeout //= DEFAULT_TIMEOUT;
$self->{'user_agent'}->timeout($timeout);
}
sub setCurrentEndpoint {
my ($self, $endpoint) = @_;
$self->{'current_endpoint'} = $endpoint;
}
lib/API/INSEE/Sirene.pm view on Meta::CPAN
my ($self, $siren_number, $desired_fields) = @_;
return 1, "Invalid SIREN $siren_number -> Must be a ${ \MAX_SIREN_LENGTH } digits number."
if $siren_number !~ m/^\d{${ \MAX_SIREN_LENGTH }}$/;
$self->setCurrentEndpoint("siren/$siren_number");
my $parameters = $self->_buildParameters($useful_fields_legal_unit, $desired_fields);
return $self->_sendRequest($parameters);
}
lib/API/INSEE/Sirene.pm view on Meta::CPAN
my ($self, $siren_number, $desired_fields) = @_;
return 1, "Invalid SIREN $siren_number -> Must be a ${ \MIN_LENGTH } digits min and ${ \MAX_SIREN_LENGTH } digits number max."
if $siren_number !~ m/^\d{${ \MIN_LENGTH },${ \MAX_SIREN_LENGTH }}$/;
$self->setCurrentEndpoint('siren');
my $criteria = $self->getCustomCriteria('siren', $siren_number, 'begin');
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
lib/API/INSEE/Sirene.pm view on Meta::CPAN
my ($self, $siret_number, $desired_fields) = @_;
return 1, "Invalid SIRET $siret_number -> Must be a ${ \MAX_SIRET_LENGTH } digits number."
if $siret_number !~ m/^\d{${ \MAX_SIRET_LENGTH }}$/;
$self->setCurrentEndpoint("siret/$siret_number");
my $parameters = $self->_buildParameters($useful_fields_establishment, $desired_fields);
return $self->_sendRequest($parameters);
}
lib/API/INSEE/Sirene.pm view on Meta::CPAN
my ($self, $siren_number, $desired_fields) = @_;
return (1, "Invalid SIREN $siren_number -> Must be a ${ \MAX_SIREN_LENGTH } digits number.")
if $siren_number !~ m/^\d{${ \MAX_SIREN_LENGTH }}$/;
$self->setCurrentEndpoint('siret');
my $criteria = $self->getCustomCriteria('siren', $siren_number);
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
lib/API/INSEE/Sirene.pm view on Meta::CPAN
my ($self, $siret_number, $desired_fields) = @_;
return 1, "Invalid SIRET $siret_number -> Must be a ${ \MIN_LENGTH } digits min and a ${ \MAX_SIRET_LENGTH } digits number max."
if $siret_number !~ m/^\d{${ \MIN_LENGTH },${ \MAX_SIRET_LENGTH }}$/;
$self->setCurrentEndpoint('siret');
my $criteria = $self->getCustomCriteria('siret', $siret_number);
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
sub getLegalUnitsByName {
my ($self, $name, $desired_fields) = @_;
$self->setCurrentEndpoint('siren');
my $criteria = $self->getCustomCriteria('denominationUniteLegale', $name);
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
sub getEstablishmentsByName {
my ($self, $name, $desired_fields) = @_;
$self->setCurrentEndpoint('siret');
my $criteria = $self->getCustomCriteria('denominationUniteLegale', $name);
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
sub getLegalUnitsByUsualName {
my ($self, $name, $desired_fields) = @_;
$self->setCurrentEndpoint('siren');
my $criteria = $self->getCustomCriteria('denominationUsuelle1UniteLegale', $name);
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
sub getEstablishmentsByUsualName {
my ($self, $name, $desired_fields) = @_;
$self->setCurrentEndpoint('siret');
my $criteria = $self->getCustomCriteria('denominationUsuelle1UniteLegale', $name);
return $self->searchByCustomCriteria($criteria, $desired_fields);
}
lib/API/INSEE/Sirene.pm view on Meta::CPAN
=head1 SYNOPSIS
use API::INSEE::Sirene;
my $sirene = API::INSEE::Sirene->new('Y29uc3VtZXIta2V5OmNvbnN1bWVyLXNlY3JldA=='); # your base64 encoded credentials
$sirene->setMaxResults(30);
# Examples to get information about an establishment with SIRET number '12345678987654'
$sirene->getEstablishmentBySIRET(12345678987654, 'all');
# or
lib/API/INSEE/Sirene.pm view on Meta::CPAN
=head1 DESCRIPTION
This module allows you to interact with the Sirene API of INSEE (Institut National de la Statistique et des Ãtudes Ãconomiques) in France.
It contains a set of functions that can perform searches on INSEE's database to get some information about french companies like their SIREN number, company name, company headquarters address, etc.
The terms "enterprise", "legal unit" and "establishment" used in this documentation are defined at the INSEE website in the following pages:
=over 4
lib/API/INSEE/Sirene.pm view on Meta::CPAN
=head1 CONSTANTS
=head2 DEFAULT_MAX_RESULTS
The API's default number of results for each request. You can override it with the C<< setMaxResults >> method. A too big value may impact response time and general performances.
This constant is set to 20 results.
=head2 DEFAULT_TIMEOUT
This constant specifies how many seconds the client module has to wait for server response before giving up. You can override it with the C<< setTimeout >> method.
This constant is set to 20 seconds.
=head2 HARD_MAX_RESULTS
The maximum number of results that you can get. This value can't be increased (restricted by API). If you try to send a request with a higher value, the C<nombre> parameter will be forced to HARD_MAX_RESULTS value.
This constant is set to 1000 results.
=head2 MAX_SIREN_LENGTH
A SIREN number has a maximum length of 9 digits.
lib/API/INSEE/Sirene.pm view on Meta::CPAN
You can choose between three search modes: 'exact', 'begin' or 'approximate' match. Default is 'approximate'.
my $criteria2 = $sirene->getCustomCriteria('libelleVoieEtablissement', 'avenue', undef, 'exact');
B<< Important: >> You must specify the endpoint to be reached B<< before >> calling the C<< getCustomCriteria >> method using C<< setCurrentEndpoint >>
$sirene->setCurrentEndpoint('siret');
=head2 getEstablishmentsByName
Search all establishments matching the specified name. (denominationUniteLegale field)
lib/API/INSEE/Sirene.pm view on Meta::CPAN
=head2 searchByCustomCriteria
This method is used to perform a search with a custom criteria built using the C<< getCustomCriteria >> method.
Before using this method, you have to specify the targeted endpoint by calling the C<< setCurrentEndpoint >> method.
my $final_criteria = "$criteria1 OR $criteria2";
my ($err, $result) = $sirene->$sirene->searchByCustomCriteria($final_criteria);
=head2 searchEstablishmentBySIRET
lib/API/INSEE/Sirene.pm view on Meta::CPAN
=head2 searchLegalUnitBySIREN
Search all legal units which SIREN number is begining by the number given in parameter.
=head2 setCredentials
You can set your credentials separately from the instantiation if you need to (but this must be done before any call to the search methods).
$sirene->setCredentials('Y29uc3VtZXIta2V5OmNvbnN1bWVyLXNlY3JldA==');
=head2 setCurrentEndpoint
Used to specifie the reached API endpoint.
=head2 setDebugMode
Enables the debug mode. When enabled, all the requests built by the module are displayed instead of being sent.
$sirene->setDebugMode(1);
=head2 setMaxResults
Used to override the B<< DEFAULT_MAX_RESULTS >> value to get more results, within the limit of B<< HARD_MAX_RESULTS >> value.
$sirene->setMaxResults(30);
=head2 setProxy
You can define which proxy server must be used to send requests. The system's proxy settings are used by default.
$sirene->setProxy('https://myproxy.com:1234');
=head2 setTimeout
Used to override the B<< DEFAULT_TIMEOUT >> value.
$sirene->setTimeout(40);
=head1 PARAMETERS
All search methods take an optional C<< $desired_fields >> parameter that comes in three differents flavours:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/ISPManager.pm view on Meta::CPAN
use API::ISPManager::mailbox;
# Addition packages
use API::ISPManager::backup;
use API::ISPManager::db;
use API::ISPManager::preset;
use API::ISPManager::stat;
use API::ISPManager::services;
use API::ISPManager::ftp;
use API::ISPManager::misc;
use API::ISPManager::file;
# VDSManager
use API::ISPManager::vds;
use API::ISPManager::diskpreset;
use API::ISPManager::vdspreset;
# BillManager
use API::ISPManager::software;
use API::ISPManager::order;
lib/API/ISPManager.pm view on Meta::CPAN
my $client_creation_result = API::ISPManager::user::create( {
%{ $connection_params },
name => 'user_login',
passwd => 'user_password',
ip => '11.11.22.33',
preset => 'template_name',
domain => $dname,
});
# Switch off account:
my $suspend_result = API::ISPManager::user::disable( {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Instagram.pm view on Meta::CPAN
my $cache_code = md5_hex( $code // $data);
# Returns cached value or creates a new object
my $return = $self->_cache($type)->{$cache_code} //= ("API::Instagram::$type")->new( $data );
# Deletes cache if no-cache is set
delete $self->_cache($type)->{$cache_code} if $self->no_cache;
return $return;
}
lib/API/Instagram.pm view on Meta::CPAN
C<scope> is the scope of access. See L<http://instagram.com/developer/authentication/#scope>.
C<response_type> and C<granty_type> do no vary. See L<http://instagram.com/developer/authentication/>.
By default, L<API::Instagram> caches created objects to avoid duplications. You can disable
this feature setting a true value to C<no_chace> parameter.
=head2 instance
my $instagram = API::Instagram->instance;
print $instagram->user->full_name;
view all matches for this distribution
view release on metacpan or search on metacpan
API/Intis/lib/API/Intis.pm view on Meta::CPAN
while((my $key, my $value) = each %config){
say "$key => $value\n";
next if $key eq 'host' || $key eq 'login' || $key eq 'APIkey';
$url .= "&$key=$value";
};
my $request = $ua->get("$url&return=$format")->decoded_content(charset => 'utf-8', raw => 1);
$request_json = $request if $format eq 'json';
$request_xml = $request if $format eq 'xml';
};
my $r = from_json($request_json);
my @error;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/MailboxOrg.pm view on Meta::CPAN
=item * mailinglist
=item * password
=item * passwordreset
=item * spamprotect
=item * test
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Medium.pm view on Meta::CPAN
server" flow and I'm using C<API::Medium> for an installed
application.
=head3 Self-issued access token / Integration token
Go to your L<settings|https://medium.com/me/settings>, scroll down to
"Integration tokens", and either create a new one, or pick the one you
want to use.
=head1 Methods
lib/API/Medium.pm view on Meta::CPAN
my $url = $m->create_post( $user_id, $post_data );
Create a new post. If you pass in bad data, Medium will probably
report an error.
C<publishStatus> is set to 'draft' unless you pass in another value.
=head2 create_publication_post
my $url = $m->create_publication_post( $publication_id, $post_data );
lib/API/Medium.pm view on Meta::CPAN
publication_id by calling the API from the commandline (until
C<publications> is implemented.)
If you pass in bad data, Medium will probably report an error.
C<publishStatus> is set to 'draft' unless you pass in another value.
=head2 TODO
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/MikroTik.pm view on Meta::CPAN
my $list = $api->command($command, $attr, $query);
die $api->error if $api->error;
for (@$list) {...}
$api->command('/user/set', {'.id' => 'admin', comment => 'System admin'});
# Non-blocking
$api->command('/ip/address/print' => sub {
my ($api, $err, $list) = @_;
lib/API/MikroTik.pm view on Meta::CPAN
Subscribe to an output of commands with continuous responses such as C<listen> or
C<ping>. Should be terminated with L</cancel>.
=head1 DEBUGGING
You can set the API_MIKROTIK_DEBUG environment variable to get some debug output
printed to stderr.
Also, you can change connection timeout with the API_MIKROTIK_CONNTIMEOUT variable.
=head1 COPYRIGHT AND LICENSE
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Name.pm view on Meta::CPAN
=head2 token
$name->token;
$name->token('TOKEN');
The token attribute should be set to the API token assigned to the account
holder.
=head2 user
$name->user;
$name->user('USER');
The user attribute should be set to the API user assgined to the account
holder.
=head2 identifier
$name->identifier;
$name->identifier('IDENTIFIER');
The identifier attribute should be set to a string that identifies your
application.
=head2 debug
$name->debug;
lib/API/Name.pm view on Meta::CPAN
=head2 url
$name->url;
$name->url(Mojo::URL->new('https://www.name.com'));
The url attribute set the base/pre-configured URL object that will be used in
all HTTP requests. This attribute expects a L<Mojo::URL> object.
=head2 user_agent
$name->user_agent;
$name->user_agent(Mojo::UserAgent->new);
The user_agent attribute set the pre-configured UserAgent object that will be
used in all HTTP requests. This attribute expects a L<Mojo::UserAgent> object.
=head1 METHODS
=head2 action
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Octopart.pm view on Meta::CPAN
The cache age (in days) before re-querying octopart. Defaults to 30 days.
=item * query_limit: die if too many API requests are made.
Defaults to no limit. I exhasted 20,000 queries very quickly due to a bug!
This might help with that, set to a reasonable limit while testing.
=item * ua_debug => 1
User Agent debugging. This is very verbose and provides API communication details.
lib/API/Octopart.pm view on Meta::CPAN
=item * max_moq => <n> - Maximum "minimum order quantity"
This is the max MOQ you will accept as being in
stock. For example, a 5000-part reel might be more
than you want for prototyping so set this to 10 or
100.
=item * seller => <regex> - Seller's name (regular expression)
This is a regular expression so something like
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
return $self->f_request( [ 'sites', $uuid, 'custom-properties' ], { req_type => 'get' } );
}
sub set_site_custom_variable {
my ( $self, %param ) = @_;
my $uuid = $self->_get_uuid( %param );
delete $param{uuid} if ( exists $param{uuid} );
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
return $self->f_request( [qw/ system custom-properties /],
{ req_type => 'get' } );
}
sub set_sites_custom_variables {
my ( $self, %param ) = @_;
return $self->f_request( [ qw/ system custom-properties / ],
{
req_type => 'put',
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
}
);
}
sub set_custom_trial_messages {
my ( $self, @param ) = @_;
return $self->f_request( [ qw/ system trial-mode messages / ],
{
req_type => 'put',
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
}
);
}
sub set_site_promo_footer_visible {
my ( $self, %param ) = @_;
my $uuid = $self->_get_uuid( %param );
return $self->f_request( [ 'sites', $uuid ], {
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
}
);
}
sub set_site_promo_footer_invisible {
my ( $self, %param ) = @_;
my $uuid = $self->_get_uuid( %param );
return $self->f_request( [ 'sites', $uuid ], {
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
);
}
sub set_limits {
my ( $self, %param ) = @_;
my $uuid = $self->_get_uuid( %param );
return $self->f_request( [ 'sites', $uuid, 'limits' ], {
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
1 | 0
This parameter is optional.
It specifies whether a text box containing an advertisement should be shown in a website footer (a section that appears at the bottom of every page on a site).
To learn more about how to set the content to be shown in the promotional footer,
see the section L<Configuring the Promotional Footer|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/71977.htm>.
L<Creating a Site|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=69689.htm>
=head2 B<gen_token($self, %param)>
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
localeCode
This parameter is optional.
It specifies the language that should be set for the user interface when the user (site owner) logs in to the editor.
The following languages are supported:
en_US - American English.
en_GB - British English.
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
L<Configuring the Trial Mode|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71623.htm>
L<Setting Trial Mode Messages|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71727.htm>
=head2 B<set_site_custom_variable($self, %param)>
Setting a Custom Variable for a Website
%param:
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
L<Configuring the Trial Mode|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71623.htm>
L<Setting Trial Mode Messages|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71727.htm>
=head2 B<set_sites_custom_variables($self, %param)>
Setting Custom Variables for All Websites
%param:
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
L<Configuring the Trial Mode|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71623.htm>
L<Setting Trial Mode Messages|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71727.htm>
=head2 B<set_custom_trial_messages($self, @param)>
Setting Custom Messages for the Trial Mode
my $response = $api->set_custom_trial_messages(
{
localeCode => 'en_US',
messages => {
defaultPersonalName => '{message1_en}',
editorTopMessageTrialSite => '{message2_en}',
lib/API/ParallelsWPB/Requests.pm view on Meta::CPAN
%param:
message
=head2 B<set_site_promo_footer_visible($self, %param)>
Showing the Promotional Footer on Websites
%param:
uuid
=head2 B<set_site_promo_footer_invisible($self, %param)>
Removing the Promotional Footer from Websites
%param:
uuid
=head2 B<set_limits>
Set limitations for single site
%param:
view all matches for this distribution