Barbie > CPAN-WWW-Testers > reports-ajax.cgi

Download:
CPAN-WWW-Testers-0.49.tar.gz

Annotate this POD

View/Report Bugs

Source  

NAME ^

reports-ajax.cgi - program to return information for a CPAN distribution.

SYNOPSIS ^

  perl reports-ajax.cgi

DESCRIPTION ^

Called in a CGI context, will return either the reporting statistics for a CPAN named distribution, or will give the date a distribution version was released to CPAN, depending upon the action requested.

ACTION MODES ^

There are two action modes available, 'reports' and 'uploaded', which provide different data regarding a specific distribution version. For both modes, basic parameters are required, while additional optional parameters are available for each mode.

Common Functionality

In both modes the distribution name and version are required. This can be derived from the 'distvers' or 'distpath' parameters as described below.

Required CGI parameters

  act       - action [required] ('reports' or 'uploaded')

  distvers  - distribution name and version
  distpath  - distribution filename or path
  dist      - distribution name
  version   - distribution version

Note that 'dist' and 'version' are required, but will be derived if you pass 'distvers' or 'distpath'

Reports Functionality

Optional Reports CGI parameters

  force     - force zeros [optional] (values: 1 only)
  grades    - grades [optional]
  patches   - allow patches [optional] (values: 1 only)
  perlver   - specific perl version required [optional]
  osname    - specific osname required [optional]

The 'grades' parameter is only used with the 'reports' action, and allows the request to specify which totals are required. If no grades are specified, the default is to return the grade totals in the following order: ALL PASS FAIL UNKNOWN NA. Note that if no grade total is available, that grade is not included in the returned string, unless the 'force' parameter is specified.

Reports Examples

  > /cgi-bin/reports-ajax.cgi?act=reports&dist=CPAN-WWW-Testers&version=0.35
  <span class="ALL">ALL (2)</span> <span class="PASS">PASS (2)</span>

  > /cgi-bin/reports-ajax.cgi?act=reports&dist=CPAN-WWW-Testers&version=0.35&force=1
  <span class="ALL">ALL (2)</span> <span class="PASS">PASS (2)</span> <span class="FAIL">FAIL (0)</span> <span class="UNKNOWN">UNKNOWN (0)</span> <span class="NA">NA (0)</span>

  > /cgi-bin/reports-ajax.cgi?act=reports&dist=CPAN-WWW-Testers&version=0.35&force=1&grades=fail,na,pass
  <span class="FAIL">FAIL (0)</span> <span class="NA">NA (0)</span> <span class="PASS">PASS (2)</span>

  > /cgi-bin/reports-ajax.cgi?act=reports&distvers=CPAN-WWW-Testers-0.35
  <span class="ALL">ALL (2)</span> <span class="PASS">PASS (2)</span>

  > /cgi-bin/reports-ajax.cgi?act=reports&distpath=CPAN-WWW-Testers-0.35.tar.gz
  <span class="ALL">ALL (2)</span> <span class="PASS">PASS (2)</span>

  > /cgi-bin/reports-ajax.cgi?act=reports&distpath=BARBIE/CPAN-WWW-Testers-0.35.tar.gz
  <span class="ALL">ALL (2)</span> <span class="PASS">PASS (2)</span>

Note that for the 'distpath' example you can provide just the distribution filename or precede it with the author's PAUSE ID.

If no reports are found a blank string is returned. On error an error string is returned.

Uploaded Functionality

Optional Uploaded CGI parameters

  epoch     - return time since epoch [optional]

When requesting the 'uploaded' action, the date returned is of the form: "YYYY/MM/DD hh::mm::ss". However, by including the 'epoch' parameter the string return will be the value of seconds since the server epoch time ("1970/01/01 00:00:00").

Uploaded Examples

  > /cgi-bin/reports-ajax.cgi?act=uploaded&dist=CPAN-WWW-Testers&version=0.35
  <span class="released">2008/09/28 15:37:50</span>

  > /cgi-bin/reports-ajax.cgi?act=uploaded&dist=CPAN-WWW-Testers&version=0.35&epoch=1
  <span class="released">1222612670</span>

If no entry for the distribution version is found '0' is returned if the epoch is requested, otherwise '0000/00/00 00:00:00' is returned. On error an error string is returned.

AJAX & HTML ^

The returning text is wrapped in HTML tags, as can be seen in the examples above. However, to appropriately use the results, you will need to include the following HTML snippet on the page:

  <div id="report_stats"></div>

It is recommended that you use the OpenThought javascript file, to enable the communication between the client and server. See the OpenThought module on CPAN for further details.

FUTUTE ENHANCEMENTS ^

Although every attempt has been made to provide as much useful functionality in these scripts, it is possible that there is further information you would want it to provide. If you have a suggestion to enhance the capability of this script, please post it as a wishlist item to the RT queue.

BUGS, PATCHES & FIXES ^

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties, that is not explained within the POD documentation, please send bug reports and patches to the RT Queue (see below).

Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me.

RT: http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-WWW-Testers

SEE ALSO ^

OpenThought

CPAN::WWW::Testers::Generator, CPAN::Testers::WWW::Statistics

http://www.cpantesters.org/, http://stats.cpantesters.org/

AUTHOR ^

  Barbie       <barbie@cpan.org>   2008-present

COPYRIGHT AND LICENSE ^

  Copyright (C) 2008-2009 Barbie <barbie@cpan.org>

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