Highlight: WYSIWYG API Gets Top Spot With 97% Growth (Feb 8th - March 29th)
Ever wondered which modules' userbase was growing fastest?
With a bit of simpleXML, 2 hours of boredom, and drupal.org's usage charts, I can provide an answer. Personally I thought the results were rather interesting.
This list only includes projects that got 6000 downloads or more last week. I picked 6000, because otherwise, ubercart wouldn't show up.
[menu_callback, and required function at end -- my toys are your toys, do with them as you like].
<?php
function mover_shaker($file = 'http://localhost/usage.html') {
$xml = simple_get_xml($file);
$table = $xml->xpath('//table[@id="project-usage-all-projects"]');
$th = 0;
$header = array(array('data' => 'rank'), array('data' => 'project'),array('data'=> 'change'));
foreach($table[0]->thead->tr[0]->th as $key => $label) {
$labels[$th] = (string)$label->a[0];
$th++;
}
$i = 0;
$last_downloads = 3000;
if ($_GET['last_downloads']) {
$last_downloads = check_plain($_GET['last_downloads']);
}
foreach($table[0]->tbody[0]->tr as $key => $data) {
if ($first = str_replace(',', '', (string)$data->td[1]) > $last_downloads) {
if ((string)$data->td[8]) {
$project = l($data->td->a[0], 'http://www.drupal.org'.$data->td->a[0]['href']);
$first = str_replace(',', '', (string)$data->td[1]);
$last = str_replace(',', '', (string)$data->td[8]);
$change = $first - $last;
$percent = $change / $last;
$percent = number_format($percent,2)." %";
$key = $i++;
$rows[$percent.'-'.$i] = array($i,$project, $percent);
$i++;
}
}
}
ksort($rows);
$rows = array_reverse($rows);
$i = 1;
foreach($rows as $key => $row) {
$rows[$key][0] = $i;
$i++;
}
return theme('table', $header, $rows);
}
function
simple_get_xml($url) {
$html = new DOMDocument();
@
$html->loadHTMLFile($url);
// convert DOM to SimpleXML
$xml = simplexml_import_dom($html);
return $xml;
}
?>| Attachment | Size |
|---|---|
| Module file for this | 1.49 KB |
Comments
Thanks for setting the bar
Thanks for setting the bar low enough for us (Ubercart) :)
Peace,
Andy
Whatever... if we were
Whatever... if we were measuring total dollars being fed into the drupal community thanks to a module, you know ubercart wouldn't have trouble making it into the top 10. Point is you're among the most important, fastest growing modules, and I couldn't live with putting up a list that didn't include you.
I think I'm a numpty, but I
I think I'm a numpty, but I can't work out how to run this code myself? How do I do this? Where does it go?
no one?
no one?
Self contained module, I'd
Self contained module, I'd recommend updating $file = 'http://drupal.org/project/usage' to a locally hosted saved version of that pages html.
http://www.nicklewis.org/files/ux_tests.zip
Added to Drupalsightings.com
Added to Drupalsightings.com
Ah, yes having this on d.o.
Ah, yes having this on d.o. would be nice. Maybe there is a chance to get it in, as everything is on the move anyway (well, I guess they are glad in San Francisco not to be faced with another feature :P)
If you would turn it into a module and a dropdown to change the threshold, this would be able to produce interesting data.
Could be done, but simple xml
Could be done, but simple xml and php voodoo is a weird way to reproduce decimal columns in mysql.
Hm. Doesn't this list really
Hm. Doesn't this list really just show which popular modules have most recently had updates?
Downloads or usage? This is
Downloads or usage?
This is really about usage and not downloads, isn't it?
Sorry my bad, it would be
Sorry my bad, it would be about usage.
Thanks for working on this
Thanks for working on this Nick! Very interesting to see that WYSIWYG API had such growth (and good to see that the unsupported and deprecated TinyMCE is declining)! Fun to see the Path redirect module which I co-maintain up at #7! :)
Thanks for massaging the
Thanks for massaging the threshold so we can show up. Nice stats!
re:image handling those
re:image handling
those modules have new maintainers..
Nice work, Nick. This is
Nice work, Nick. This is something that could / should be on d.o. directly. Issue link here: http://drupal.org/node/430540
Also twittered on @Drupal account. I couldn't find if you had a twitter username to link to.
As much as love simpleXML --
As much as love simpleXML -- this would be child's play with SQL.
Post new comment