package WWW::SourceForge;
use strict;
use LWP::Simple qw(get);
use JSON::Parse;
use XML::Feed;
use File::HomeDir;
our $VERSION = '0.73'; # This is the overall version for the entire
# package, so sho
,
},
ref($class) || $class
);
return $self;
}
=head2 call
Usage : my $json = $sfapi->call(
method => whatever,
arg1 => 'value',
rss',
);
Returns : Hashref, containing a bunch of data. Format defaults to
'json', but in some cases, you'll want to force rss because that's
how the return is available. Wi
use WWW::SourceForge;
use WWW::SourceForge::Project;
use LWP::Simple qw();
use Data::Dumper;
use JSON::Parse;
use LWP::UserAgent;
use LWP::Authen::OAuth;
use HTTP::Request::Common;
our $VERSION = '0
the JSON and parse it. Die on bad JSON;
=cut
sub get {
my ( $self, %parameters ) = @_;
my $r = {};
my $json = LWP::Simple::get( $parameters{url} );
eval { $r = JSON::Parse::json_to_
perl( $json ); };
if ( $@ ) {
warn $@;
return {};
} else {
return $r;
}
}
=head1 post_page
$self->post_page(
page => 'NewPage',
text => 'Wiki page bo
rge;
my $json;
if ( $parameters{id} ) {
warn("The Sourceforge API no longer understands user IDs.");
return 0;
} elsif ( $parameters{username} ) {
$json = $api->cal
'You must provide an id or username. Bad monkey.');
return 0;
}
$self->{data} = $json;
return $self;
}
sub email { return shift->sf_email(); }
=head2 projects
Returns an array
= $api;
my $json;
if ( $parameters{id} ) {
warn('The API does not support project IDs any more');
return 0;
} elsif ( $parameters{name} ) {
$json = $api->call(
arn('You must provide an id or name. Bad monkey.');
return 0;
}
$self->{data} = $json;
return $self;
}
=head2 admins
@admins = $project->admins();
Returns a list of WWW::Sour
end_date -> '2012-07-25'
);
=cut
# https://sourceforge.net/projects/xbmc/files/stats/json?start_date=2010-05-01&end_date=2010-05-11
sub downloads {
my $self = shift;
my %args = @_