cpanvote - a Perl mini-project
For many, CPAN is a Canadian Prairies-sized field of modules where itÃ¢ÂÂs darn hard to separate the wheat from the chaff.
While the CPAN Ratings service is the principal and official way CPAN tries to rank its distributions, for me at least, it doesnÃ¢ÂÂt quite scratch the itch becauseÃÂ .ÃÂ .ÃÂ .ÃÂ
- not all distributions have reviews.
- even when there are reviews, they generally donÃ¢ÂÂt answer the next question: what should I use, instead?.
Consequently, for a while now IÃ¢ÂÂve been playing with ideas on how the rating could be improved. What I came up with so far is a very minimal system going straight for the goods, where a rating would consist of:
- The rating proper, which can be one of three values: Ã¢ÂÂthumb-upÃ¢ÂÂ, Ã¢ÂÂthumb-downÃ¢ÂÂ, or Ã¢ÂÂneutralÃ¢ÂÂ.
- If you give the distribution a thumb-down (or for that matter, even if you give it a thumb up), you can recommend another distribution to be used instead.
- An accompanying short comment (140 characters or less so that itÃ¢ÂÂs Twitter-ready. Longer, proper reviews can be done via CPAN Ratings).
AaaandÃÂ .ÃÂ .ÃÂ .ÃÂ thatÃ¢ÂÂs it. Not exactly mind-blowing, but itÃ¢ÂÂs so simple it could actually work.
JFDI, you say?
And now, since IÃ¢ÂÂve had a three-day week, I decided to give the idea a try and implement a prototype. Because I had only so many hours to devote to the project (hey, it was Valentine Day, after all), IÃ¢ÂÂve built it as a REST service. That way I didnÃ¢ÂÂt have to spend any time on prettiness and, if the idea does to catch on, it can easily be grafted to a web site, IRC/IM bot, phone service, search.cpan.org (well, I can dream big, canÃ¢ÂÂt I?), and so on.
The cpanvote code is on Github. ItÃ¢ÂÂs all rather untidy, but itÃ¢ÂÂs (roughly) functional. LetÃ¢ÂÂs have a little tour of the application via the example REST client
cpanvote.pl included in the repo, shall we?
First, we need an account, which can be created via the client:
$ cpanvote.pl --register --user max --password min
(And yes, this way of creating users is rather brain-dead, but this is only a rough prototype, so itÃ¢ÂÂll do for now.)
Once an account is created, reviews are as simple as:
$ cpanvote.pl --user max --password min XML-XPathScript --yeah
$ cpanvote.pl --user yanick --password foo Games::Perlwar --meh --comment "could use a little Catalyst love"
$ cpanvote.pl --user yanick --password foo Dist-Release --neah --instead Dist-Zilla --comment "nice try, but RJS is just better at it"
For the time being, I have implemented only very simple per-distribution results, which can be queried via any browser:
$ lynx -dump http://localhost:3000/dist/Dist-Release/summary --- comments: - nice try, but RJS is just better at it - cute instead: - Dist-Zilla vote: meh: ~ neah: 1 yeah: 1
$ lynx -dump http://localhost:3000/dist/Dist-Release/detailed --- - comment: nice try, but RJS is just better at it instead: Dist-Zilla vote: -1 who: yanick - comment: cute vote: +1 who: max
For the curious, I have an instance of the application running at http://babyl.dyndns.org:3000 (cpanvote.pl Ã¢ÂÂhost babyl.dyndns.org:3000 Ã¢ÂÂ¦). ItÃ¢ÂÂs running a single-thread Catalyst with debug information, using a SQLite back-end on my home machine, which has rather pathetic bandwidth throughput, so please be gentle and donÃ¢ÂÂt be too too surprised if it goes down.
This is the moment where I turn to the audience and prod them (that is, you) to see if I might be on to something, or if IÃ¢ÂÂd be better to stop talking now. In other words, whatÃ¢ÂÂs your thought on this:
Random thoughts for the next steps (assuming that there will be a next step).
- Review accounts could potentially be PAUSE-based.
- Give peeps the opportunity to submit tags for the module alongside their review, and let the taxonomy short itself ÃÂ la Deli.cio.us.
- We could go meta all the way and vote on reviewers as well, which could give their opinion more weight.