Welcome to the Pandora FMS Module Library

 
This is a library with modules, documentation and tools for Pandora FMS users, both public Open Source and Enterprise. Please use your support credentials (same as used to enter support/ticketing system) in the menu to your right. You will be granted access to a resourceful module library, such as Oracle, VMware, JBoss and others, ready to be used in production enviroments, with official professional support from Artica. If you do not own an enterprise account, you still can browse and download lots of modules, you can even register a free account and contribute with your own modules/tools for other public users.

Home > Tools

A project downloads in Sourceforge.net

Author: Create in: 01/02/2013 Update in: 01/01/1970
Rating:
Module type : Remote plugin plugin


A so simple php script that get from sourceforge API the number of downloads of a project between two dates.

Syntax:

php5 ./sf_downloads.php project_name start_date end_date

NOTES:

* Project name must be the short name on sourceforge used, in example, in the URL of the project like https://sourceforge.net/projects/PROJECT_NAME

* Start and end date must be in YYYY-MM-DD format

Module data

<?php
/*
Get the downloads between two dates of a project from sourceforge.net
*/

if(isset($argv[1])) {
$project = $argv[1];
}
else {
$project = 'pandora';
}

if(isset($argv[2])) {
$start_date = $argv[2];
}
else {
$start_date = '2012-01-01';
}

if(isset($argv[3])) {
$end_date = $argv[3];
}
else {
$end_date = '2012-12-31';
}

$json_stats = file_get_contents("https://sourceforge.net/projects/$project/files/stats/json?start_date=$start_date&end_date=$end_date");
$stats = json_decode($json_stats, true);
echo $stats['total'];
?>