Update: I've just updated the bookmarklet, I added the option to tell it the team size, it was hardcoded at 200, now you can put the value, also it doesn't show members with 0 karma. I'll probably get off my laziness and code it in perl/python
Este es un pequeño javascript para obtener una lista de los miembros de un equipo de launchpad, organizada por el karma, utilizando el API de launchpad.net y Mochikit.
Arrastren el enlace a su barra de favoritos, y luego dentro de www.launchpad.net hagan clic en el: Karma table
Este es el codigo mejor organizado, para el que lo quiera ver:
javascript:(
function(){
var d = loadJSONDoc('/api/devel/~'+prompt('Team name:', 'ubuntu-co')+'/members?ws.size=200');
d.addBoth(function (res) {
res.entries.sort(function(a,b) { return parseFloat(b.karma) - parseFloat(a.karma) } );
msg = "";
for (i=0;i<res.total_size;i++) {
msg = msg + "\r\n" + '<tr><td>'+(i+1)+'</td>
<td><a href="/~'+res.entries[i].name+'">'+res.entries[i].display_name+'</a></td>
<td>'+res.entries[i].karma+'</td></tr>';
};
document.body.innerHTML="<table class=\"listing\" id=\"activemembers\">
<thead><tr><th> </th><th>Name</th><th>Karma</th></tr></thead>
<tbody>"+msg+"</tbody>
</table>";
});
}
)();
