Quantcast
Channel: Planet Ubuntu
Viewing all articles
Browse latest Browse all 17727

Hollman Enciso: How To Obtain Your Team Members Karma From Launchpad .net

$
0
0

One of our communuty members, Fernando (you can check his blog at http://blog.beford.org ) post some weeks ago this small javascript that could be pretty useful for other LoCoTeams. I' m transcribing his post here for public consumption.

This little javascript obtains a sorted list of members from any Launchpad Team by karma. It's using the Launchpad API and Mochikit

In order to test it you should drag the Karma table link to your favorites bar, then you must go to www.launchpad.net. When you're there just clic on the Karma table favorite and it would ask you for the team you want to check and voíla.. you'd get your favorite's team karma sorted member list.

This is the code so everyone can take a look on it:

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>&nbsp;</th><th>Name</th><th>Karma</th></tr></thead>
<tbody>"+msg+"</tbody>
</table>";
});
}
)();

Best regards from Ubuntu Colombia.

For the original post please check http://blog.beford.org/2010/07/30/obtener-lista-de-karma-en-teams-launchpad-net/

read more


Viewing all articles
Browse latest Browse all 17727

Trending Articles