NAME

WWW::Ohloh::API - Ohloh API implementation

SYNOPSIS

use WWW::Ohloh::API;

my $ohloh = WWW::Ohloh::API->new( api_key => $my_api_key );
my $account $ohloh->get_account( id => 12933 );

print $account->name;

DESCRIPTION

This module is a Perl interface to the Ohloh API as defined at http://www.ohloh.net/api/getting_started.

METHODS

new( [ api_key => $api_key ] )

Create a new WWW::Ohloh::API object. To be able to retrieve information from the Ohloh server, an api key must be either passed to the constructor or set via the set_api_key method.

my $ohloh = WWW::Ohloh::API->new( api_key => $your_key );

get_account( [ id | email ] => $account_id )

Return the account associated with the $account_id as a WWW::Ohloh::API::Account object. If no such account exists, an error is thrown. The $accound_id can either be specified as the Ohloh id number, or the email address associated with the account.

my $account = $ohloh->get_account( id => 12933 );
my $other_accound = $ohloh->get_account( email => 'foo@bar.com' );

get_project( $id )

Return the project having the Ohloh id $id as a WWW::Ohloh::API::Project. If no such project exists, an error is thrown.

my $project = $ohloh->get_project( 1234) ;
print $project->name;

get_projects( query => $query, sort => $sorting_order, max => $nbr )

Return a set of projects as a WWW::Ohloh::API::Projects object.

Parameters

query

If provided, only the projects matching the query string are returned. A project matches the query string is any of its name, description or tags does.

sort

If provided, the projects will be returned according to the specified sorting order. Valid values are 'created_at', 'description', 'id', 'name', 'stack_count', 'updated_at', 'created_at_reverse', 'description_reverse', 'id_reverse', 'name_reverse', 'stack_count_reverse' or 'updated_at_reverse'. If no sorting order is explicitly given, 'id' is the default.

max

If given, the project set will returns at most $nbr projects.

# get top ten stacked projects
my @top = $ohloh->get_projects( max => 10, sort => 'stack_count' )->all;

get_languages( sort => $order )

Return the languages known to Ohloh a set of WWW::Ohloh::API::Language objects.

An optional sort parameter can be passed to the method. The valid $orders it accepts are total, code, projects, comment_ratio, contributors, commits and name. If sort is not explicitly called, projects are returned in alphabetical order of names.

get_activity_facts( $project_id, $analysis )

Return a set of activity facts computed out of the project associated with the $project_id as a WWW::Ohloh::API::ActivityFacts object.

The optional argument $analysis can be either an Ohloh analysis id (which must be an analysis associated to the project) or the keyword 'latest'. By default the latest analysis will be queried.

SEE ALSO

VERSION

This document describes WWW::Ohloh::API version 0.0.4

BUGS AND LIMITATIONS

WWW::Ohloh::API is very extremely alpha quality. It'll improve, but till then: Caveat emptor.

Please report any bugs or feature requests to bug-www-ohloh-api@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Yanick Champoux <yanick@cpan.org>

LICENCE AND COPYRIGHT

Copyright (c) 2008, Yanick Champoux <yanick@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.