Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2014 11:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7accf04ac6bd300055ec to your computer and use it in GitHub Desktop.
Save anonymous/7accf04ac6bd300055ec to your computer and use it in GitHub Desktop.
Press Numpad 0 to show your language streaks
// ==UserScript==
// @name Display language streaks
// @namespace http://xaasd.werd.asd
// @version 0.2
// @description: Press Numpad 0 to display language streaks. Wrapper for code from pinkodoug
// @include http://www.duolingo.com/*
// @include https://www.duolingo.com/*
// @copyright 2014+
// ==/UserScript==
document.addEventListener('keyup', function(event) {
if(event.keyCode === 96){ // Numpad 0
var expAlert="Site Streak: "+duo.user.attributes.site_streak+"\n";
for(var i in duo.user.attributes.languages){
if (duo.user.attributes.languages[i].learning){
expAlert=expAlert+duo.user.attributes.languages[i].language_string+" Streak: "+duo.user.attributes.languages[i].streak;
expAlert=expAlert+" Lvl: "+duo.user.attributes.languages[i].level+" XP:"+duo.user.attributes.languages[i].points+" lvlup: ";
expAlert=expAlert+duo.user.attributes.languages[i].to_next_level+"\n";
}
}
window.alert(expAlert);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment