So, I am giving some thought to this,... but in the meantime I thought it would be interesting to see just some very basic raw download counts. In particular to see raw download counts on my own modules. (After all, CPAN doesn't automatically give this type of info and its not everyday you get access to nicely cleaned up logs like this) So I whipped this up, just grep the raw log for a PAUSE id and pipe the output into this script (passing in 'module' or 'distro' or nothing for both).

#!/usr/bin/perl use strict; use warnings; my ($by_module, $by_distro); ($by_module, $by_distro) = (1, 1) unless @ARGV; while (my $arg = shift(@ARGV)) { $by_module = 1 if lc($arg) =~ 'module'; $by_distro = 1 if lc($arg) =~ 'distro'; } my %total_downloads_by_module; my %total_downloads_by_distro; while (<>) { my ($url) = /\d{5}\s(.*)/; my @path = split /\// => $url; my $module_distro = pop @path; $total_downloads_by_distro{$module_distro}++ if $by_distro; if ($by_module) { my ($module) = ($module_distro =~ /(.*?)\-\d\..*?.tar\.gz/); $total_downloads_by_module{$module}++; } } format_report("Total Downloads by Module", %total_downloads_by_module) + if $by_module; format_report("Total Downloads by Distro", %total_downloads_by_distro) + if $by_distro; sub format_report { my ($header, %hash) = @_; print "+---------------------------------------\n"; print "| $header\n"; print "+------+--------------------------------\n"; print join "\n" => map { "| " . sprintf("%4d", $hash{$_}) . " | " . $_ } sort { $hash{$a} <=> $hash{$b} } keys %hash; print "\n+------+--------------------------------\n"; }

BTW - The reg-exp for extracting the module name is horrible and could use a lot of help (*hint* *hint*).

-stvn

In reply to Re: Help update the Phalanx 100 by stvn
in thread Help update the Phalanx 100 by petdance

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.