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).
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?
There have been some significant changes to MetaCPAN. search.metacpan.org still relies on the old/current api which can be found at api.metacpan.org. The new api is currently in a beta phase and available at api.beta.metacpan.org. beta.metacpan.org provides a more conservative and search-engine friendly front-end for that.
search.metacpan.org is pretty much a proof of concept for the api and how easy it is to query it using javascript.
Also, beta.metacpan.org hasn't been publicly announced yet since it contains still a lot of mock-up code and needs some cleaning up (and documentation)
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.