view release on metacpan or search on metacpan
lib/Endoscope.pm view on Meta::CPAN
queries and view their output can read the contents of nearly any variable
present in memory. As such, access to these capabilities should be carefully
guarded.
For example, if C<Endoscope> is integrated into a web framework and exposes
a special HTTP endpoint for configuring queries, that endpoint should only be
accessible from the host where the application is running, not externally.
Additionally, that HTTP endpoint should be gated by strong
authentication/authorization.
=head1 SEE ALSO
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/benchmark.pl view on Meta::CPAN
<p>You see, <a href="https://metacpan.org">MetaCPAN</a> does not only have a pretty face,
but also has a <a href="https://github.com/CPAN-API/cpan-api/wiki/Beta-API-docs">smashing backend</a>
that can be used <a href="http://explorer.metacpan.org/">straight-up</a> for fun and
profit.</p>
<p>Accessing REST endpoints is not hard, but it's a little bit of a low-level
chore. In Perl space, there is already <a href='http://search.cpan.org/dist/MetaCPAN-API'>MetaCPAN::API</a> to
abstract</p>
<pre class="brush: perl">my $ua = LWP::UserAgent;
my $me = decode_json(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Etcd.pm view on Meta::CPAN
Queries and returns the server version as a string.
=head1 ENDPOINTS
Individual API endpoints are implemented in separate modules. See the documentation for the following modules for more information:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Etcd3/Auth.pm view on Meta::CPAN
# grant role
$etcd->user_role( { user => 'samba', role => 'myrole' })->grant;
=cut
=head2 endpoint
=cut
has endpoint => (
is => 'ro',
isa => Str,
);
=head2 password
lib/Etcd3/Auth.pm view on Meta::CPAN
=cut
sub authenticate {
my ( $self, $options ) = @_;
$self->{endpoint} = '/auth/authenticate';
confess 'name and password required for ' . __PACKAGE__ . '->authenticate'
unless ($self->{password} && $self->{name});
$self->request;
return $self;
}
lib/Etcd3/Auth.pm view on Meta::CPAN
=cut
sub enable {
my ( $self, $options ) = @_;
$self->{endpoint} = '/auth/enable';
$self->{json_args} = '{}';
$self->request;
return $self;
}
lib/Etcd3/Auth.pm view on Meta::CPAN
=cut
sub disable {
my ( $self, $options ) = @_;
$self->{endpoint} = '/auth/disable';
confess 'root name and password required for ' . __PACKAGE__ . '->disable'
unless ($self->{password} && $self->{name});
$self->request;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EveOnline/SSO/Client.pm view on Meta::CPAN
has 'token' => (
is => 'rw',
required => 1,
);
has 'endpoint' => (
is => 'rw',
required => 1,
default => 'https://esi.tech.ccp.is/latest/',
);
lib/EveOnline/SSO/Client.pm view on Meta::CPAN
Require arguments: token, x_user_agent
my $client = EveOnline::SSO::Client->new(
token => 'lPhJ_DLk345334532yfssfdJgFsnKI9rR4EZpcQnJ2',
x_user_agent => 'Pilot Name <email@gmail.com>',
endpoint => 'https://esi.tech.ccp.is/latest/', # optional
datasource => 'tranquility', # optional
);
For module based on EveOnline::SSO::Client
you can override atributes:
extends 'EveOnline::SSO::Client';
has '+endpoint' => (
is => 'rw',
default => 'https://esi.tech.ccp.is/dev/',
);
has '+datasource' => (
is => 'rw',
lib/EveOnline/SSO/Client.pm view on Meta::CPAN
return $resource if $resource =~ /^http/i;
my $url = '';
$url = $self->endpoint;
$url .= join '/', @$resource;
$url .= '/';
my $uri = URI->new( $url );
$uri->query_form( %{$params || {}}, datasource => $self->datasource );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Excel/Writer/XLSX/Shape.pm view on Meta::CPAN
=head2 adjustments
Adjustment of shape vertices. Most shapes do not use this. For some shapes, there is a single adjustment to modify the geometry. For instance, the plus shape has one adjustment to control the width of the spokes.
Connectors can have a number of adjustments to control the shape routing. Typically, a connector will have 3 to 5 handles for routing the shape. The adjustment is in percent of the distance from the starting shape to the ending shape, alternating bet...
=head2 stencil
Shapes work in stencil mode by default. That is, once a shape is inserted, its connection is separated from its master. The master shape may be modified after an instance is inserted, and only subsequent insertions will show the modifications.
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Exobrain/Agent/Foursquare.pm view on Meta::CPAN
my $checkins = $self->foursquare_api('checkins/recent',
afterTimestamp => $last_check,
);
Calls the Foursquare API endpoint specified in the first argument, and converts
the response into a Perl data structure. All additional named arguments are
considered to be parameters that will be appended to the call.
This method automatically adds auth tokens and version strings as appropriate.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Exobrain/Bus.pm view on Meta::CPAN
# ABSTRACT: Connection to the Exobrain bus
our $VERSION = '1.08'; # VERSION
my $context = ZMQ::Context->new; # Context is always shared.
my $endpoint = 'tcp://localhost:3568/'; # TODO: From config file?
my $router = Exobrain::Router->new;
has context => ( is => 'ro', default => sub { $context } );
has router => ( is => 'ro', default => sub { $router } );
has type => ( is => 'ro', ); # TODO: Type
view all matches for this distribution
view release on metacpan or search on metacpan
Change: 274137bfe1e2b49a199b4f6a2be69019aa323535
Author: Tudor Constantin <tudorconstantin@gmail.com>
Date : 2012-07-09 00:28:23 +0000
basic infrastructure created for API endpoints
Change: e6eb43b478630acea753e8d72dc93c6c2a933181
Author: Tudor Constantin <tudorconstantin@gmail.com>
Date : 2012-07-08 21:49:07 +0000
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FAST/Bio/Location/Atomic.pm view on Meta::CPAN
=head2 min_end
Title : min_end
Usage : my $minend = $location->min_end();
Function: Get minimum ending location of feature endpoint
Returns : integer or undef if no minimum ending point.
Args : none
=cut
lib/FAST/Bio/Location/Atomic.pm view on Meta::CPAN
=head2 max_end
Title : max_end
Usage : my $maxend = $location->max_end();
Function: Get maximum ending location of feature endpoint
In this implementation this is exactly the same as min_end().
Returns : integer or undef if no maximum ending point.
Args : none
view all matches for this distribution
view release on metacpan or search on metacpan
examples/zmq3.pl view on Meta::CPAN
use FFI::CheckLib qw( find_lib_or_die );
use FFI::Platypus 2.00;
use FFI::Platypus::Memory qw( malloc );
use FFI::Platypus::Buffer qw( scalar_to_buffer window );
my $endpoint = "ipc://zmq-ffi-$$";
my $ffi = FFI::Platypus->new(
api => 2,
lib => find_lib_or_die lib => 'zmq',
);
examples/zmq3.pl view on Meta::CPAN
my $context = zmq_ctx_new();
zmq_ctx_set($context, ZMQ_IO_THREADS, 1);
my $socket1 = zmq_socket($context, ZMQ_REQ);
zmq_connect($socket1, $endpoint);
my $socket2 = zmq_socket($context, ZMQ_REP);
zmq_bind($socket2, $endpoint);
{ # send
our $sent_message = "hello there";
my($pointer, $size) = scalar_to_buffer $sent_message;
my $r = zmq_send($socket1, $pointer, $size, 0);
view all matches for this distribution
view release on metacpan or search on metacpan
deps/hidapi/hidapi/hidapi.h view on Meta::CPAN
if a hid report is 16 bytes long, 17 bytes must be passed to
hid_write(), the Report ID (or 0x0, for devices with a
single report), followed by the report data (16 bytes). In
this example, the length passed in would be 17.
hid_write() will send the data on the first OUT endpoint, if
one exists. If it does not, it will send the data through
the Control Endpoint (Endpoint 0).
This function sets the return value of hid_error().
deps/hidapi/hidapi/hidapi.h view on Meta::CPAN
int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length);
/** @brief Read an Input report from a HID device with timeout.
Input reports are returned
to the host through the INTERRUPT IN endpoint. The first byte will
contain the Report number if the device uses numbered reports.
This function sets the return value of hid_error().
@ingroup API
deps/hidapi/hidapi/hidapi.h view on Meta::CPAN
int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds);
/** @brief Read an Input report from a HID device.
Input reports are returned
to the host through the INTERRUPT IN endpoint. The first byte will
contain the Report number if the device uses numbered reports.
This function sets the return value of hid_error().
@ingroup API
deps/hidapi/hidapi/hidapi.h view on Meta::CPAN
*/
int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *dev, int nonblock);
/** @brief Send a Feature report to the device.
Feature reports are sent over the Control endpoint as a
Set_Report transfer. The first byte of @p data[] must
contain the Report ID. For devices which only support a
single report, this must be set to 0x0. The remaining bytes
contain the report data. Since the Report ID is mandatory,
calls to hid_send_feature_report() will always contain one
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Facebook/OpenGraph.pm view on Meta::CPAN
client_secret => $self->secret,
};
my $response = $self->request('GET', '/oauth/access_token', $param_ref);
# Document describes as follows:
# "The response you will receive from this endpoint, if successful, is
# access_token={access-token}&expires={seconds-til-expiration}
# If it is not successful, you'll receive an explanatory error message."
#
# It, however, returnes no "expires" parameter on some edge cases.
# e.g. Your app requests manage_pages permission.
lib/Facebook/OpenGraph.pm view on Meta::CPAN
This module is inspired by L<Facebook::Graph>, but mainly focuses on simplicity
and customizability because we must be able to keep up with frequently changing
API specification.
This module does B<NOT> provide ways to set and validate parameters for each
API endpoint like Facebook::Graph does with Any::Moose. Instead it provides
some basic methods for HTTP request. It also provides some handy methods that
wrap C<request()> for you to easily utilize most of Graph API's functionalities
including:
=over 4
lib/Facebook/OpenGraph.pm view on Meta::CPAN
=item * Posting Staging Resource for Open Graph Object
=back
In most cases you can specify endpoints and request parameters by yourself and
pass them to request() so it should be easier to test latest API specs. Other
requesting methods merely wrap request() method for convinience.
=head1 METHODS
lib/Facebook/OpenGraph.pm view on Meta::CPAN
It parses signed_request that Facebook Platform gives to you on various
situations. situations may include
=over 4
=item * Given as a URL fragment on callback endpoint after login flow is done
with Login Dialog
=item * POSTed when Page Tab App is loaded
=item * Set in a form of cookie by JS SDK
lib/Facebook/OpenGraph.pm view on Meta::CPAN
DB and override this method to return the stored value.
=head3 C<< $fb->get_user_token_by_code($given_code) >>
Obtain an access token for user based on C<$code>. C<$code> should be obtained
on your callback endpoint which is specified on C<eredirect_uri>. Give the
returning access token to C<set_access_token()> and you can act on behalf of
the user.
FYI: I<expires> or I<expires_in> is B<NOT> returned on some edge cases. The
detail and reproductive scenario should be found at
lib/Facebook/OpenGraph.pm view on Meta::CPAN
]);
# 'name,email,albums.fields(name,photos.fields(name,picture,tags.limit(2)).limit(3)).limit(5)'
=head3 C<< $fb->publish_action($action_type, \%param) >>
Alias to C<request()> that optimizes body content and endpoint to send C<POST>
request to publish Open Graph Action.
my $res = $fb->publish_action('give', +{crap => 'https://sample.com/poop/'});
#{id => 123456}
view all matches for this distribution
view release on metacpan or search on metacpan
FDkeeper/Client.pm view on Meta::CPAN
while (my ($k, $v) = each %args){
croak("Invalid attribute '$k'") ;
}
my $client = endp_connect($path) ;
croak("Error connecting to server endpoint '$path': $!") unless $client ;
$client->autoflush(1) ;
$this->{client} = $client ;
return $this ;
}
view all matches for this distribution
view release on metacpan or search on metacpan
FDpasser.pm view on Meta::CPAN
=head1 DESCRIPTION
File::FDpasser is a module for passing open filedescriptors
to and from other scripts or even other programs.
An endpoint is just a Filehandle that can be used to
send and receive filehandles over. To create two endpoints
before forking spipe() is used - it returns two endpoints
or undef on failiure.
If the processes are unrelated or can not use spipe() for
some reason, it is possible to create a 'server endpoint'
in the filesystem by calling endp_create(). That endpoint
can be polled for incomming connections similar to how sockets
are polled for incomming connection. To accept an incomming
connection serv_accept_fh() is used. It returns a filehandle
or undef on failiure.
To connect to a server endpoint from a client program
endp_connect() is used. It returns a filehandle to an
open connection.
Irregardless of how the endpoints were created send_file()
is used to send an open filehandle to the process who has
other end of the pipe or socket. The first argument to
send_file is the connection to send the open handle over.
The second argument is the actual handle to send.
Similarly recv_fh() is always used to receive an open
FDpasser.pm view on Meta::CPAN
Under BSD derived systems open filedescriptors are passed over
unix domain sockets. SysV systems however pass them over streams.
This means to create that under BSD socketpair() is used to
create the socket endpoints. While SysV uses pipe() since
pipe on SysV creates a bidirectional stream based pipe.
This is all nice and dandy if you are going to fork later on
since both child and parent are going to have an endpoint to
read from or write to.
endp_create() is used to create a server endpoint that can
be polled for incomming connections with poll or select.
Under BSD the perl call socket() is used to create a Unix Domain
Socket in the filesystem. Under SysV the perl function pipe()
is called followed by an XS function that pushes the conn_ld module
on one end of the stream pipe and then calles fattach to attach
the pipe end to a point in the filesystem.
To connect to a server endpoint in BSD a socket is created (but not
bound to any point in the filesystem) and a connect call is made.
In SysV a normal open() in perl is made.
The actuall sending of filedescriptors is done with XS functions
that under BSD use sendmsg for sending and recvmsg for reciving.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Fu/Dir.pm view on Meta::CPAN
if(@want == 2) {
foreach my $end (@want) {
$end = $#{$self->{dirs}} + 1 + $end if($end < 0);
}
if($want[0] > $want[1]) {
croak("first endpoint '$want[0]' is after last '$want[1]'");
}
@want = $want[0]..$want[1];
}
# TODO else check contiguity?
return(@{$self->{dirs}}[@want]);
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/VirusScan/Engine/Daemon/FPROT/V4.pm view on Meta::CPAN
while (my $output = $sock->getline) {
if($output =~ /^\s*$/) {
last; # End of headers
#### Below here: Validating the protocol
#### If the protocol is not recognized, it's assumed that the
#### endpoint is not an F-Prot demon, hence,
#### the next port is probed.
} elsif($output =~ /^HTTP(.*)/) {
my $h = $1;
next SEARCH_DEMON unless $h =~ m!/1\.0\s+200\s!;
} elsif($output =~ /^Server:\s*(\S*)/) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Alpaca.pm view on Meta::CPAN
return $ua;
}
has api_version => ( is => 'ro', isa => Enum [ 1, 2 ], required => 1, default => 2 );
has paper => ( is => 'rw', isa => Bool, required => 1, default => 0, coerce => 1 );
sub endpoint ($s) {
$s->paper ? 'https://paper-api.alpaca.markets' : '';
}
has keys => ( is => 'rwp', isa => ArrayRef [ Str, 2 ], predicate => 1 );
#
sub account ($s) {
my $tx = $s->ua->build_tx( GET => $s->endpoint . '/v2/account' );
$tx = $s->ua->start($tx);
return to_Account( $tx->result->json );
}
sub clock ($s) {
my $tx = $s->ua->build_tx( GET => $s->endpoint . '/v2/clock' );
$tx = $s->ua->start($tx);
return to_Clock( $tx->result->json );
}
sub calendar ( $s, %params ) {
my $params = '';
$params .= '?' . join '&', map {
$_ . '='
. ( ref $params{$_} eq 'Time::Moment' ? $params{$_}->to_string() : $params{$_} )
} keys %params if keys %params;
my $tx = $s->ua->build_tx( GET => $s->endpoint . '/v2/calendar' . $params );
$tx = $s->ua->start($tx);
return @{ ( ArrayRef [Calendar] )->assert_coerce( $tx->result->json ) };
}
sub assets ( $s, %params ) {
lib/Finance/Alpaca.pm view on Meta::CPAN
$_ . '='
. ( ref $params{$_} eq 'Time::Moment' ? $params{$_}->to_string() : $params{$_} )
} keys %params if keys %params;
return @{
( ArrayRef [Asset] )->assert_coerce(
$s->ua->get( $s->endpoint . '/v2/assets' . $params )->result->json
)
};
}
sub asset ( $s, $symbol_or_asset_id ) {
my $res = $s->ua->get( $s->endpoint . '/v2/assets/' . $symbol_or_asset_id )->result;
return $res->is_error ? () : to_Asset( $res->json );
}
sub bars ( $s, %params ) {
my $symbol = delete $params{symbol};
lib/Finance/Alpaca.pm view on Meta::CPAN
for ( keys %params ) {
$params{$_} = $params{$_}->to_string() if ref $params{$_} eq 'Time::Moment';
}
return @{
( ArrayRef [Order] )->assert_coerce(
$s->ua->get( $s->endpoint . '/v2/orders' => form => {%params} )->result->json
)
};
}
sub order_by_id ( $s, $order_id, $nested = 0 ) {
my $res
= $s->ua->get(
$s->endpoint . '/v2/orders/' . $order_id => form => ( $nested ? { nested => 1 } : () ) )
->result;
return $res->is_error ? () : to_Order( $res->json );
}
sub order_by_client_id ( $s, $order_id ) {
my $res
= $s->ua->get( $s->endpoint
. '/v2/orders:by_client_order_id' => form => { client_order_id => $order_id } )
->result;
return $res->is_error ? () : to_Order( $res->json );
}
sub create_order ( $s, %params ) {
$params{extended_hours} = ( !!$params{extended_hours} ) ? 'true' : 'false'
if defined $params{extended_hours};
my $res = $s->ua->post( $s->endpoint . '/v2/orders' => json => \%params )->result;
return $res->is_error ? $res->json : to_Order( $res->json );
}
sub replace_order ( $s, $order_id, %params ) {
$params{extended_hours} = ( !!$params{extended_hours} ) ? 'true' : 'false'
if defined $params{extended_hours};
my $res
= $s->ua->patch( $s->endpoint . '/v2/orders/' . $order_id => json => \%params )->result;
return $res->is_error ? $res->json : to_Order( $res->json );
}
sub cancel_orders ($s) {
my $res = $s->ua->delete( $s->endpoint . '/v2/orders' )->result;
return $res->is_error
? $res->json
: ( ArrayRef [ Dict [ body => Order, id => Uuid, status => Int ] ] )
->assert_coerce( $res->json );
}
sub cancel_order ( $s, $order_id ) {
my $res = $s->ua->delete( $s->endpoint . '/v2/orders/' . $order_id )->result;
return !$res->is_error;
}
sub positions ($s) {
return
@{ ( ArrayRef [Position] )
->assert_coerce( $s->ua->get( $s->endpoint . '/v2/positions' )->result->json ) };
}
sub position ( $s, $symbol_or_asset_id ) {
my $res = $s->ua->get( $s->endpoint . '/v2/positions/' . $symbol_or_asset_id )->result;
return $res->is_error ? () : to_Position( $res->json );
}
sub close_all_positions ( $s, $cancel_orders = !1 ) {
my $res
= $s->ua->delete(
$s->endpoint . '/v2/positions' . ( $cancel_orders ? '?cancel_orders=true' : '' ) )
->result;
return $res->is_error
? $res->json
: ( ArrayRef [ Dict [ body => Order, id => Uuid, status => Int ] ] )
->assert_coerce( $res->json );
}
sub close_position ( $s, $symbol_or_asset_id, $qty = () ) {
my $res
= $s->ua->get(
$s->endpoint . '/v2/positions/' . $symbol_or_asset_id . ( $qty ? '?qty=' . $qty : '' ) )
->result;
return $res->is_error ? () : to_Order( $res->json );
}
sub portfolio_history ( $s, %params ) {
lib/Finance/Alpaca.pm view on Meta::CPAN
$params{date_end}
= ref $params{date_end} eq 'Time::Moment'
? $params{date_end}->strftime('%F')
: $params{date_end}
if defined $params{date_end};
my $res = $s->ua->get( $s->endpoint . '/v2/account/portfolio/history' => json => \%params )
->result;
return $res->is_error ? $res->json : (
Dict [
base_value => Num,
equity => ArrayRef [Num],
lib/Finance/Alpaca.pm view on Meta::CPAN
}
sub watchlists ($s) {
return
@{ ( ArrayRef [Watchlist] )
->assert_coerce( $s->ua->get( $s->endpoint . '/v2/watchlists' )->result->json ) };
}
sub create_watchlist ( $s, $name, @symbols ) {
my $res
= $s->ua->post( $s->endpoint
. '/v2/watchlists' => json =>
{ name => $name, ( @symbols ? ( symbols => \@symbols ) : () ) } )->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub delete_watchlist ( $s, $watchlist_id ) {
my $res = $s->ua->delete( $s->endpoint . '/v2/watchlists/' . $watchlist_id )->result;
return $res->is_error ? $res->json : 1;
}
sub watchlist ( $s, $watchlist_id ) {
my $res = $s->ua->get( $s->endpoint . '/v2/watchlists/' . $watchlist_id )->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub update_watchlist ( $s, $watchlist_id, %params ) {
my $res
= $s->ua->put( $s->endpoint . '/v2/watchlists/' . $watchlist_id => json => {%params} )
->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub add_to_watchlist ( $s, $watchlist_id, $symbol ) {
my $res
= $s->ua->post(
$s->endpoint . '/v2/watchlists/' . $watchlist_id => json => { symbol => $symbol } )
->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub remove_from_watchlist ( $s, $watchlist_id, $symbol ) {
my $res = $s->ua->delete( $s->endpoint . '/v2/watchlists/' . $watchlist_id . '/' . $symbol )
->result;
return $res->is_error ? ( $res->json ) : to_Watchlist( $res->json );
}
sub configuration ($s) {
my $res = $s->ua->get( $s->endpoint . '/v2/account/configurations' )->result;
return $res->is_error ? ( $res->json ) : to_Configuration( $res->json );
}
sub modify_configuration ( $s, %params ) {
my $res = $s->ua->patch( $s->endpoint . '/v2/account/configurations' => json => {%params} )
->result;
return $res->is_error ? ( $res->json ) : to_Configuration( $res->json );
}
sub activities ( $s, %params ) {
lib/Finance/Alpaca.pm view on Meta::CPAN
: ref $params{$_} eq 'ARRAY' ? @{ $params{$_} }
: $params{$_}
)
} keys %params if keys %params;
my $res = $s->ua->get(
sprintf $s->endpoint . '/v2/account/activities%s',
$params ? $params : ''
)->result;
return $res->is_error
? $res->json
: map { $_->{activity_type} eq 'FILL' ? to_TradeActivity($_) : to_Activity($_) }
lib/Finance/Alpaca.pm view on Meta::CPAN
my $acct = $camelid->account( );
CORE::say sprintf 'I can%s short!', $acct->shorting_enabled ? '' : 'not';
Returns a L<Finance::Alpaca::Struct::Account> object.
The account endpoint serves important information related to an account,
including account status, funds available for trade, funds available for
withdrawal, and various flags relevant to an accountâs ability to trade.
=head2 C<clock( )>
lib/Finance/Alpaca.pm view on Meta::CPAN
$clock->timestamp->strftime('It is %l:%M:%S %p on a %A and the market is %%sopen!'),
$clock->is_open ? '' : 'not ';
Returns a L<Finance::Alpaca::Struct::Clock> object.
The clock endpoint serves the current market timestamp, whether or not the
market is currently open, as well as the times of the next market open and
close.
=head2 C<calendar( [...] )>
lib/Finance/Alpaca.pm view on Meta::CPAN
$day->date, $day->open;
}
Returns a list of L<Finance::Alpaca::Struct::Calendar> objects.
The calendar endpoint serves the full list of market days from 1970 to 2029.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
say $_->symbol
for sort { $a->symbol cmp $b->symbol } @{ $camelid->assets( status => 'active' ) };
Returns a list of L<Finance::Alpaca::Struct::Asset> objects.
The assets endpoint serves as the master list of assets available for trade and
data consumption from Alpaca.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
);
Returns a list of L<Finance::Alpaca::Struct::Bar> objects along with other
data.
The bar endpoint serves aggregate historical data for the requested securities.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
);
Returns a list of L<Finance::Alpaca::Struct::Quote> objects along with other
data.
The bar endpoint serves quote (NBBO) historical data for the requested
security.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
);
Returns a list of L<Finance::Alpaca::Struct::Trade> objects along with other
data.
The bar endpoint serves historical trade data for a given ticker symbol on a
specified date.
The following parameters are accepted:
=over
lib/Finance/Alpaca.pm view on Meta::CPAN
my @orders = $camelid->orders( status => 'open' );
Returns a list of L<Finance::Alpaca::Struct::Order> objects.
The orders endpoint returns a list of orders for the account, filtered by the
supplied parameters.
The following parameters are accepted:
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Bitcoin/Feed/Site/CoinSetter/Socket.pm view on Meta::CPAN
return {} unless @pieces;
my $id = $pieces[1] || '';
$data = $pieces[4] || '';
my $packet = {
type => $packets[$pieces[0]],
endpoint => $pieces[3] || '',
};
# whether we need to acknowledge the packet
if ($id) {
$packet->{id} = $id;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/FB_low_level_api.pl view on Meta::CPAN
use 5.010;
use Finance::Bitcoin::API;
my $creds = shift @ARGV or die "Please provide username:password as a parameter.\n";
my $uri = 'http://'.$creds.'@127.0.0.1:8332/';
my $api = Finance::Bitcoin::API->new( endpoint => $uri );
my $balance = $api->call('getbalance');
say($balance || $api->error);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/CoinbasePro/Lite.pm view on Meta::CPAN
=head1 DESCRIPTION
Coinbase Pro, L<https://pro.coinbase.com>, is a US cryptocurrency exchange. This
module provides a Perl wrapper for Coinbase Pro's API. Please peruse the
Coinbase Pro API reference to see which API endpoints are available.
=head1 METHODS
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
CompanyNames/TextSupport.pm view on Meta::CPAN
bemuse bemused bemusedly bemusement bemuses
bench benched bencher benchers benches benching benchings
benchmark benchmarked benchmarker benchmarkers benchmarking benchmarks
benchtest benchtests
bend bendability bendable bended bender benders bending bendings bends
bendpoint bendpoints
benediction benedictions
benefactor benefactors
benefical beneficial beneficially beneficials
benefication beneficiate beneficiated beneficiating beneficiation
beneficiares beneficiaries beneficiary
CompanyNames/TextSupport.pm view on Meta::CPAN
endotoxin endotoxins
endotracheal endotracheally
endow endowed endowing endowment endowments endows
endpiece endpieces
endplate endplates
endpoint endpoints
endring endrings
endset endsets
endurable endurance endurances endure endured endures enduring
endwall endwalls
enema enemas
CompanyNames/TextSupport.pm view on Meta::CPAN
endowed
endowing
endowment
endowments
endows
endpoint
ends
endurable
endurably
endurance
endure
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Dogecoin/API.pm view on Meta::CPAN
use LWP::UserAgent;
use LWP::Protocol::https;
use URI::QueryParam;
has 'api_key', is => 'ro', required => 1;
has 'endpoint', is => 'ro', default => sub { 'https://www.dogeapi.com/wow/' };
has 'json', is => 'ro', default => sub {
my $j = JSON->new; $j->allow_nonref; $j
};
has 'ua', is => 'ro', default => sub {
lib/Finance/Dogecoin/API.pm view on Meta::CPAN
sub request {
my ($self, $method, %params) = @_;
# manually setting the 'a' parameter avoids a weird behavior in LWP::UA
# which uppercases 'a'--not what the API expects or wants
my $uri = URI->new( $self->endpoint );
$uri->query_param( a => $method );
while (my ($key, $value) = each %params) {
$uri->query_param( $key => $value );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/GDAX/API/Order.pm view on Meta::CPAN
=head2 C<product_id>
A valid product id
The product_id must match a valid product. The products list is
available via the /products endpoint.
=head2 C<stp>
[optional] Self-trade prevention flag
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/GDAX/Lite.pm view on Meta::CPAN
=head1 DESCRIPTION
L<https://gdax.com> is a US cryptocurrency exchange. This module provides a Perl
wrapper for GDAX's API. This module is an alternative to L<Finance::GDAX::API>
and is more lightweight/barebones (no entity objects, Moose, etc). Please peruse
the GDAX API reference to see which API endpoints are available.
=head1 METHODS
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/MtGox.pm view on Meta::CPAN
sub _secret {
my ($self) = @_;
return $self->{secret};
}
# build a URI object for the endpoint of an API call
sub _build_api_method_uri {
my ( $self, $version, $name, $prefix ) = @_;
my $version_url_token = "api/" . $version;
$prefix = $prefix ? "$prefix/" : '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Robinhood.pm view on Meta::CPAN
#
has token => (is => 'ro', writer => '_set_token');
#
my $base = 'https://api.robinhood.com/';
# Different endpoints we can call for the API
my %endpoints = (
'accounts' => 'accounts/',
'accounts/positions' => 'accounts/%s/positions/',
'portfolios' => 'portfolios/',
'portfolios/historicals' => 'portfolios/historicals/',
'ach_deposit_schedules' => 'ach/deposit_schedules/',
lib/Finance/Robinhood.pm view on Meta::CPAN
'user/identity_mismatch' => 'user/identity_mismatch',
'watchlists' => 'watchlists/',
'watchlists/bulk_add' => 'watchlists/%s/bulk_add/'
);
sub endpoint {
$endpoints{$_[0]} ?
($DEV > 10 ?
'http://brokeback.dev.robinhood.com/'
: 'https://api.robinhood.com/'
)
. $endpoints{+shift}
: ();
}
#
# Send a username and password to Robinhood to get back a token.
#
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($self, $username, $password) = @_;
# Make API Call
my ($status, $data, $raw)
= _send_request(undef, 'POST',
Finance::Robinhood::endpoint('login'),
{username => $username,
password => $password
}
);
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($self) = @_;
# Make API Call
my ($status, $rt, $raw)
= $self->_send_request('POST',
Finance::Robinhood::endpoint('logout'));
return $status == 200 ?
# The old token is now invalid, so we might as well delete it
$self->_set_token(())
: ();
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($email) = @_;
# Make API Call
my ($status, $rt, $raw)
= _send_request(undef, 'POST',
Finance::Robinhood::endpoint('password_reset/request'),
{email => $email});
return $status == 200;
}
sub change_password {
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($user, $password, $token) = @_;
# Make API Call
my ($status, $rt, $raw)
= _send_request(undef, 'POST',
Finance::Robinhood::endpoint('password_reset'),
{username => $user,
password => $password,
token => $token
}
);
lib/Finance/Robinhood.pm view on Meta::CPAN
}
sub user_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET', Finance::Robinhood::endpoint('user'));
return $status == 200 ?
map { $_ => $data->{$_} } qw[email id last_name first_name username]
: ();
}
sub user_id {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('user/id'));
return $status == 200 ? $data->{id} : ();
}
sub basic_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('user/basic_info'));
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) }
qw[date_of_birth updated_at]
),
lib/Finance/Robinhood.pm view on Meta::CPAN
sub additional_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint(
'user/additional_info')
);
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) } qw[updated_at]),
lib/Finance/Robinhood.pm view on Meta::CPAN
sub employment_info {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('user/employment'));
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) } qw[updated_at]),
map { m[user] ? () : ($_ => $data->{$_}) } keys %$data);
}
sub investment_profile {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint(
'user/investment_profile')
);
return $status != 200 ?
()
: ((map { $_ => _2_datetime(delete $data->{$_}) } qw[updated_at]),
lib/Finance/Robinhood.pm view on Meta::CPAN
sub identity_mismatch {
my ($self) = @_;
my ($status, $data, $raw)
= $self->_send_request('GET',
Finance::Robinhood::endpoint(
'user/identity_mismatch')
);
return $status == 200 ? $self->_paginate($data) : ();
}
sub accounts {
my ($self) = @_;
# TODO: Deal with next and previous results? Multiple accounts?
my $return = $self->_send_request('GET',
Finance::Robinhood::endpoint('accounts')
);
return $self->_paginate($return, 'Finance::Robinhood::Account');
}
#
# Returns the porfillo summery of an account by url.
lib/Finance/Robinhood.pm view on Meta::CPAN
my ($self) = @_;
# TODO: Deal with next and previous results? Multiple portfolios?
my $return =
$self->_send_request('GET',
Finance::Robinhood::endpoint('portfolios'));
return $self->_paginate($return, 'Finance::Robinhood::Portfolio');
}
sub instrument {
lib/Finance/Robinhood.pm view on Meta::CPAN
#my ($results) = $rh->instrument({cursor => 'cD04NjQ5'});
#my $msft = $rh->instrument({id => '50810c35-d215-4866-9758-0ada4ac79ffa'});
my $self = shift if ref $_[0] && ref $_[0] eq __PACKAGE__;
my ($type) = @_;
my $result = _send_request($self, 'GET',
Finance::Robinhood::endpoint('instruments')
. ( !defined $type ? ''
: !ref $type ? '?query=' . $type
: ref $type eq 'HASH'
&& defined $type->{cursor}
? '?cursor=' . $type->{cursor}
lib/Finance/Robinhood.pm view on Meta::CPAN
sub quote {
my $self = ref $_[0] ? shift : (); # might be undef but that's okay
#if (scalar @_ > 1 or wantarray) {
my $return =
_send_request($self, 'GET',
Finance::Robinhood::endpoint('quotes') . '?symbols=' . join ',',
@_);
return _paginate($self, $return, 'Finance::Robinhood::Quote');
#}
#my $quote =
# _send_request($self, 'GET',
# Finance::Robinhood::endpoint('quotes') . shift . '/');
#return $quote ?
# Finance::Robinhood::Quote->new($quote)
# : ();
}
lib/Finance/Robinhood.pm view on Meta::CPAN
my $self = ref $_[0] ? shift : (); # might be undef but that's okay
#if (scalar @_ > 1 or wantarray) {
my $return =
_send_request($self,
'GET',
Finance::Robinhood::endpoint('fundamentals')
. '?symbols='
. join ',',
@_
);
return _paginate($self, $return, 'Finance::Robinhood::Fundamentals');
#}
#my $quote =
# _send_request($self, 'GET',
# Finance::Robinhood::endpoint('quotes') . shift . '/');
#return $quote ?
# Finance::Robinhood::Quote->new($quote)
# : ();
}
lib/Finance/Robinhood.pm view on Meta::CPAN
my $fields = join '&', map { $_ . '=' . $fields{$_} }
grep { defined $fields{$_} } keys %fields;
my ($status, $data, $raw)
= _send_request($self,
'GET',
Finance::Robinhood::endpoint('quotes/historicals')
. "$symbol/"
. ($fields ? "?$fields" : '')
);
return if $status != 200;
for (@{$data->{historicals}}) {
lib/Finance/Robinhood.pm view on Meta::CPAN
}
sub locate_order {
my ($self, $order_id) = @_;
my $result = $self->_send_request('GET',
Finance::Robinhood::endpoint('orders') . $order_id . '/');
return $result ?
Finance::Robinhood::Order->new(rh => $self, %$result)
: ();
}
sub list_orders {
my ($self, $type) = @_;
my $result = $self->_send_request(
'GET',
Finance::Robinhood::endpoint('orders')
. (
ref $type
&& ref $type eq 'HASH'
&& defined $type->{cursor} ? '?cursor=' . $type->{cursor}
: ref $type && ref $type eq 'HASH' && defined $type->{'since'}
lib/Finance/Robinhood.pm view on Meta::CPAN
return $self->_paginate($result, 'Finance::Robinhood::Order');
}
# Methods under construction
sub cards {
return shift->_send_request('GET', Finance::Robinhood::endpoint('cards'));
}
sub dividends {
return
shift->_send_request('GET',
Finance::Robinhood::endpoint('dividends'));
}
sub notifications {
return
shift->_send_request('GET',
Finance::Robinhood::endpoint('notifications'));
}
sub notifications_devices {
return
shift->_send_request('GET',
Finance::Robinhood::endpoint(
'notifications/devices')
);
}
sub create_watchlist {
my ($self, $name) = @_;
my ($status, $result)
= $self->_send_request('POST',
Finance::Robinhood::endpoint('watchlists'),
{name => $name});
return $status == 201
?
Finance::Robinhood::Watchlist->new(rh => $self, %$result)
: ();
lib/Finance/Robinhood.pm view on Meta::CPAN
sub delete_watchlist {
my ($self, $watchlist) = @_;
my ($status, $result, $response)
= $self->_send_request('DELETE',
Finance::Robinhood::endpoint('watchlists')
. (ref $watchlist ?
$watchlist->name()
: $watchlist
)
. '/'
lib/Finance/Robinhood.pm view on Meta::CPAN
}
sub watchlists {
my ($self, $cursor) = @_;
my $result = $self->_send_request('GET',
Finance::Robinhood::endpoint(
'watchlists')
. (
ref $cursor
&& ref $cursor eq 'HASH'
&& defined $cursor->{cursor}
lib/Finance/Robinhood.pm view on Meta::CPAN
sub watchlist {
my ($self, $name) = @_;
my ($status, $result)
= $self->_send_request('GET',
Finance::Robinhood::endpoint('watchlists') . "$name/");
return $status == 200 ?
Finance::Robinhood::Watchlist->new(name => $name,
rh => $self,
%$result
)
lib/Finance/Robinhood.pm view on Meta::CPAN
sub markets {
my $self = ref $_[0] ? shift : (); # might be undef but that's okay
my ($symbol, $interval, $span) = @_;
my $result = _send_request(undef, 'GET',
Finance::Robinhood::endpoint('markets'));
return _paginate($self, $result, 'Finance::Robinhood::Market');
}
# TESTING!
# @GET("/documents/{id}/download/?redirect=False")
# Observable<DocumentDownloadResponse> getDocumentDownloadUrl(@Path("id") String str);
sub documents_download {
my ($s, $id, $redirect) = @_;
warn Finance::Robinhood::endpoint('documents/download');
my $result =
_send_request($s, 'GET',
sprintf Finance::Robinhood::endpoint('documents/download'),
$id, $redirect ? 'True' : 'False');
#return _paginate( $self, $result, 'Finance::Robinhood::Market' );
$result;
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.002 2018-09-07 Released-By: PERLANCAR
- [bugfix] There's a hard limit on number of rows returned by
GetSecuritiesStock endpoint, iterate to get all results.
0.001 2018-09-07 Released-By: PERLANCAR
- First release.
view all matches for this distribution