1. Forum
  2. >
  3. Topic: Duolingo
  4. >
  5. Userscript: Tree trimmer!

https://www.duolingo.com/profile/Torsby

Userscript: Tree trimmer!

Hi,

When I saw k_k 's post (https://www.duolingo.com/comment/7139374) about the idea for a trimmable tree, I decided to make an userscript for that. :)

It adds a button to the tree, which allows you to filter out all golden skills, locked skills and test-out buttons with one click. So that you can focuss on the skills you need to practice.

You can get it here: https://monkeyguts.com/code.php?id=813

You need the Chrome extention Tampermonkey or the firefox add-on Greasemonkey in order for this to work!

UPDATE: The script now remembers that your tree is trimmed.

<h1>Important bugfix and cosmetic update</h1>

erdnaoluap told me about a bug where the skill icon disappeared while in a lesson, this bug is fixed now!

I also changed the colour of the button to a more plesant blue :)

Please update your version of the script (greasemonkey might tell you that there is an update, but I am not sure about that... you can always reinstall the script from: https://monkeyguts.com/code.php?id=813)

February 21, 2015

42 Comments


https://www.duolingo.com/profile/CharmingTiger

Nice work! I'm just starting to get into the userscripts.

I really like the one that allows you to see other people's trees and daily xp progress.

I found the course switcher one to be extremely useful with switching to and from the reverse course.

The one that changes your color scheme to a black background is really cool when looking at an entirely gold tree (gold on black), but is a bit hard on the eyes when navigating throughout the rest of the site.

I know you can already do this manually, but if a userscript that allowed you to see other peoples' lingots was developed, I would probably get that as well.


https://www.duolingo.com/profile/spiffwalker

Could you please link those other ones you mentioned?

Thanks in advance!


https://www.duolingo.com/profile/JeskeH

Maybe we should list all of them somewhere :)


https://www.duolingo.com/profile/TheWiseTurtle

The problem with the one that allows you to see other's trees is that it only works if they did Immersion, and the daily XP chart looks ugly in my opinion :/


https://www.duolingo.com/profile/aphirst

As far as I can tell, MonkeyGuts is down. Is there the possibility that this script could get re-uploaded elsewhere?


https://www.duolingo.com/profile/arekolek

The author is not responding, in the meantime I posted a mirror here.

Update: now it's a new script in its own right, check out this discussion thread to see what's changed.


https://www.duolingo.com/profile/johnlvs2run

Do you happen to have a mirror to install the hide fluency button userscript?

Apparently some people see a button, but all the link shows to me is code, no button, and the author is not available. All the other userscripts have installed fine.


https://www.duolingo.com/profile/johnlvs2run

It works! Thanks very much.


https://www.duolingo.com/profile/Immortalizd

Do you have a mirror to the "More Duo!" script?


https://www.duolingo.com/profile/arekolek

Unfortunately, I don't.


https://www.duolingo.com/profile/albernegiraffe

Neat! Looks to work great :)


https://www.duolingo.com/profile/Eey91

Question, If I trim the tree and then use the "strengthen skills" button it will work as usual or will only strengthen non golden skills?


https://www.duolingo.com/profile/Torsby

As far as I'm concerned that button never strenthened golden skills. But this script doesn't change anything to that button, so all works as it does without this script. :)


https://www.duolingo.com/profile/Eey91

Ok, the thing is that a skill can be golden but not all the vocabulary strengthened. Sometimes this option include this vocabulary that's why I was interested. I'm going to try it!

Edit: It works fine! thanks. Just one suggestion, is it possible to add different colors for the "trim/untrim" buttons? for example Duo's blue / green button colors. I know it changes nothing but it would look nicer hehe.


https://www.duolingo.com/profile/MultiLinguAlex

It works perfectly, thank you very much! :-)


https://www.duolingo.com/profile/mehlon

Greetings, fellow scripter from the Netherlands!
You can make clickable links with [text](link) (it's markdown). I have made a compatible version of my script which does not conflict with yours.
Some other things: You should replace cookies with localStorage and replace the jQuery in your script with CSS injection (that would also allow you to remove the onHomeAdded function as CSS updates itself automatically). Also, for updating to work properly, you gotta increment @version in meta.js in order for automatic updates to work.


https://www.duolingo.com/profile/Torsby

Woehoe, Nederlander! Thanks for your tips! I will rewrite the script using that :). Can you tell me a little more about the CSS injection, do you mean to replace the toggle function? And something else... this script seems to conflict with Duolingo's notification button. But I have no idea why.

TypeError: Cannot read property 'defaultView' of undefined {stack: (...), message: "Cannot read property 'defaultView' of undefined"}

^ That's what the javascript console says when I click the nofication button with the Tree trimmer enabled, but I have seriously no idea why.... any guesses?


https://www.duolingo.com/profile/mehlon

Also, what I meant by CSS injection was to add a <style> and edit that element to make .gold elements invisible, but that didn't actually work when I tried it so instead I used jQuery $('.skill-icon.gold').parent().remove().


https://www.duolingo.com/profile/MultiLinguAlex

EDIT: It's working again!

Okay, it was working perfectly until I tried to untrim the tree after I practiced one skill and reached my daily goal: Untrimming it was impossible to me. The tree kept being trimmed, whether I tried to untrim my tree or not. Maybe you could have a look at it? Screenshots:

1 trimmed:

2 untrimmed:

...but I had to disable the whole script in order to see my normal tree again. Please fix this and then the script should be working perfectly again. I keep you updated whether I can find a bug again =)


https://www.duolingo.com/profile/Torsby

I will look at it, I will have to recreate the situation first. Have you tried reinstalling it? Because I did fix somehing after the first update.


https://www.duolingo.com/profile/Torsby

I recreated the situation by practining a skill and this didn't happen. So I guess you have an old version of the script then?


https://www.duolingo.com/profile/MultiLinguAlex

Exactly, I updated it and it's working again =)


https://www.duolingo.com/profile/Torsby
<h1>Important bugfix and cosmetic update</h1>

erdnaoluap told me about a bug where the skill icon disappeared while in a lesson, this bug is fixed now!

I also changed the colour of the button to a more plesant blue :)


https://www.duolingo.com/profile/JeskeH

This is so cool, love that you're taking time for such things :) Thank you, very helpful add-on.


https://www.duolingo.com/profile/Moomingirl

My question is, if people like you can do this, why on earth can't Duolingo? Especially with the tree switching one, which is a pain in the behind as it currently stands. I love the idea of 'trimming the tree' too. Does that mean it doesn't show anything if all your skills are gold?


https://www.duolingo.com/profile/8451746

I can't get the URL for the script to work. Can I install the script from anywhere else?


https://www.duolingo.com/profile/TheWiseTurtle

Your userscript for trimming the tree is neat. However, I noticed that there is a bug, in which I enabled the userscript, the notifications button (the bell at the top-right corner of the screen) won't work. When I disabled the userscript it worked again. Can you please fix this? Thanks. It's annoying to have to disable and reenable it every time I want to check my notifications.


https://www.duolingo.com/profile/corienepien

The link is not opening a page. Is there another way i can find this script? it seems awesome!


https://www.duolingo.com/profile/mattoleriver

Scroll about halfway back up this page to where someone has posted a link. I just added it today (11/14/2015) and it seems to work well.


https://www.duolingo.com/profile/LJSulli

Hi, it seems that monkeyguts.com is down. Would you be able to re-upload this to github?


https://www.duolingo.com/profile/Paranoix

Hello, if you are still looking for this script then you should try: https://gist.github.com/arekolek/9ad313f411d0f8858681


https://www.duolingo.com/profile/cherub721

This is a fantastic idea. I guess it's not possible to do this on the app, though? That's where the scrolling annoys me the most. But I'll definitely install it on the computer at least.


https://www.duolingo.com/profile/filipmc

This is wonderful. Thank you!

Have you considered showing a little count of how many gold circles were hidden, and how many non-started circles were hidden, to help show the users current progress? (Just a thought.)


https://www.duolingo.com/profile/Torsby

That's a good idea, I might look into it soon! So an update (and thus a working link) can be expected soon!


https://www.duolingo.com/profile/ArdeJohnson

Is this thread current? Do I report bugs here?


https://www.duolingo.com/profile/GloMendez

How exactly do you install a script on Tampermonkey? I seem to be having problems with it.


https://www.duolingo.com/profile/FrankelPopankel

I don't know about Tampermonkey, but with Greasemonkey, you just have to open the script in your browser and you're given the option to install it. Perhaps it's similar?


https://www.duolingo.com/profile/FrankelPopankel

This is pretty nice; I love not having to scroll all the way down past my gold skills. However, I'd like to also see the skills which are locked so I can get a feel for how far I have left to go and to see what's coming up.
If I comment out the line:
$('.skill-icon.small.locked').parent().add('.skill-tree-row.row-shortcut').toggle(!trimmed);
I see the locked skills, but also all the checkpoints which have already been passed. Is there a simple way to do what I want?


https://www.duolingo.com/profile/ISpeakAlien

What exactly does this do?

Learn a language in just 5 minutes a day. For free.