Language learning is big part of my life. Currently I’m focused on German and Russian. I’ve done formal classes, talked with native speakers, and used apps. Of my favourite apps is Duolingo. It has a great interface and set of features. When paired with other resources for self guided learning I think it is powerful.
Problem came a few months ago when I started getting a ton of notification spam. Suddenly I had 340+ friends and needed to know about every 7 days streak they went on.
Everything in their interface is nice but why these annoying notifications! How did I get all these friends? Was my account hacked? After a password change things calmed down and the number of friends did not increase. The problem remained how to get rid of these fake friends?
Unfortunately the user interface around friends is pretty basic and to unfollow you have to go to each user individual page and click unfollow. The great number of accounts to unfollow made this impractical. I could have contacted Duolingo support but I’m more of a do it yourself user. I came up with my own solution.
Meet delete_my_duolingo_friends.py it is a python script that utilises Chrome WebDriver to programmatically login to duolingo’s web interface, go to your friends list and loop through all your friends going to their profile pages and clicking unfollow. I’ve posted the script here as a paste on source hut. It is simple to use with environmental variables for your Duolingo credentials.
I originally learned about Chrome Driver while writing end to end tests for work but the technology can easily be applied to web scraping like I did for this project.