-
-
Save vova/bd2bd2180868e38f93e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').html('<table id="words"><thead><tr><th>Language</th><th>Category</th><th>Word</th><th>Strength</th></thead><table>'); | |
var ld = duo.user.attributes.language_data; | |
for (l in ld) { | |
ld[l].skills.models.forEach(function(model) { | |
var a = model.attributes; | |
if (a.progress_percent > 0) { | |
$.get('/skills/' + a.language + '/' + a.url_title, function(skill) { | |
skill.path.forEach(function(path) { | |
if (path.words && path.strength > 0) { | |
path.words.forEach(function(word) { | |
var h = "<tr>"; | |
h += "<td>" + l + "</td>"; | |
h += "<td>" + a.name + "</td>"; | |
h += "<td>" + word + "</td>"; | |
h += "<td>" + path.strength + "</td>"; | |
h += "</tr>"; | |
$("#words").append(h); | |
}); | |
} | |
}); | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$('body').html('
var ld = duo.user.attributes.language_data;
for (l in ld) {
ld[l].skills.models.forEach(function(model) {
var a = model.attributes;
if (a.progress_percent > 0) {
$.get('/skills/' + a.language + '/' + a.url_title, function(skill) {
skill.path.forEach(function(path) {
if (path.words && path.strength > 0) {
path.words.forEach(function(word) {
var h = "";
h += "";
h += "";
h += "";
h += "";
h += "";
$("#words").append(h);
});
}
});
});
}
});
}