Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kentnl/net-travis-api

Low Level Plumbing for travis-ci.org's api
https://github.com/kentnl/net-travis-api

perl

Last synced: 4 days ago
JSON representation

Low Level Plumbing for travis-ci.org's api

Awesome Lists containing this project

README

        

# NAME

Net::Travis::API - Low Level Plumbing for travis-ci.org's api

# VERSION

version 0.002001

# DEVELOPMENT

This code is highly in-development, and is feature incomplete, and does not presently represent all API functions available.

At present, most the functionality is lower-level plumbing functions which should eventually give way to a higher level API.

But code endeavors to approach better coverage eventually, and hopefully serve as a better documentation than Travis's own API
docs, which were so lackluster I had to resort to sniffing their websites traffic from my browser to understand what was going
on.

# AUTHENTICATION

Presently this module only covers the overhead of getting authentication working with travis, so that you can do arbitrary
requests and get useful responses.

And this was the #1 challenge from the Travis API docs, because this process is poorly documented, and fettered with
documentation about things documented not to be implemented yet.

So, at present, you have several options:

- 1. Work with an unauthenticated User Agent.

use Net::Travis::API::UA;

my $ua = Net::Travis::API::UA->new();

$ua->get('/repos/someuser'); # Public Endpoint

- 2. Use the GitHub Authentication Module to get an authenticated agent.

use Net::Travis::API::Auth::GitHub;

my $ua = Net::Travis::API::Auth::GitHub->get_authorised_ua_for( $token );

$ua->get('/users'); # private endpoint

- 3. Get an authorization token some other way.

And avoid incurring an authorization request overhead.

use Net::Travis::API::UA;

my $ua = Net::Travis::API::UA->new(
authtokens => [ $token ]
);

$ua->get('/users'); # private endpoint

# AUTHOR

Kent Fredric <[email protected]>

# COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Kent Fredric <[email protected]>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.