Skip to content

Instantly share code, notes, and snippets.

@vova
Forked from coffenbacher/Duolingo World List
Last active May 2, 2017 23:03
Show Gist options
  • Save vova/bd2bd2180868e38f93e3 to your computer and use it in GitHub Desktop.
Save vova/bd2bd2180868e38f93e3 to your computer and use it in GitHub Desktop.
$('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);
});
}
});
});
}
});
}
@bbbiljanaaa
Copy link

$('body').html('

LanguageCategoryWordStrength
');
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);
});
}
});
});
}
});
}

" + l + "" + a.name + "" + word + "" + path.strength + "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment