GitHub-like activity indicator for authors and distributions

(Note: open the post to see the indicators. blogs.perl.org doesn't show them on the summary page)

Indexing the whole CPAN to the beta version of MetaCPAN just finished. Here is one example of what you can do with the data available from MetaCPAN:

This is rafl's activity over the last 24 month.

And the activity of the Plack distribution.

If you want to include these indicators on your homepage, copy paste the following code:

For distributions:


<object data="http://beta.metacpan.org/activity?res=month&distribution=Plack" width="170" height="22" type="image/svg+xml" />

For authors:


<object data="http://beta.metacpan.org/activity?res=month&author=FLORA" width="170" height="22" type="image/svg+xml" />

(Note: author name must be all upper-case)

All uploads:


<object data="http://beta.metacpan.org/activity?res=month" width="170" height="22" type="image/svg+xml" />

Right now the width, height and number of month is hard-coded. Feel free to fork and fix that at https://github.com/CPAN-API/metacpan-web (relevant files are template/activity.xml and lib/MetaCPAN/Web/Controller/Activity.pm).

3 Comments

Wow, this is great!
I think I missed something, why are there two separate sites beta.metacpan.org and search.metacpan.org? Is search.metacpan.org considered deprecated (being early proof of concept) and will go down soon?

That looks sweet!

In the output SVG, I'd like to suggest to change `width="100%" height="100%"` to some pixel value like `width="177px" height="22px"`. This makes it looks nicer to when using img tag to contain the svg, and it is also possible to change width/height in CSS.

Leave a comment

About mo

user-pic I blog about Perl.