Duolingo Streak Helper Widget with Discord notification support

This widget displays:

  • Your current Duolingo Streak (which changes color depending on how high it is)
  • The time till your next streak begins or ends
  • Whether or not you’ve finished the streak today
  • Optionally sends you a message on discord through a webhook at a certain hour of day of your choice if you haven’t completed your streak yet.

Here’s what mine looks like right now:

Screenshot_20240302-074351

Here’s what the discord notification looks like:

Here are two screenshots displaying when a streak is finished or unfinished:

This widget is themed according the rest of my Nothing Phone, I encourage you salvage parts of this komponent and use it for yourself. If you wish to see the code for something, let me know and I’ll tell you how I did it.


Duolingo’s API:

Duolingo has an undocumented API (there are many unofficial APIs that attempt to document it.). You can access the link I mentioned below while logged in (gives you a lot more data) or you can access it anonymously which still gives you enough data to do what I did. You might want to google to learn more if you’re interested since this is all I know.
API Link: https://duolingo.com/2017-06-30/users?username=YourUsernameHere

How are you checking if the streak is completed?

This certain parameter in their JSON:
.users[0].streakData.currentStreak.endDate
This parameter tells you the last time you participated in the streak. If this date is lesser than the current date, you have yet to participate in your streak today, hence incomplete. I am still unsure what happens if there’s no streak, but there’s fallbacks for that which should hopefully work.

Discord Notifications:

You will have to set a few globals before this works:

  • Set your webhook url. This will send messages in that channel as long as the webhook is active.
  • Set the hour you would like this to trigger if unfinished (24 hour). 17 by default.
  • Set your Discord user ID (not username) optionally if you would like to be pinged by the webhook.

Note that this is not very well tested and might bug out, feel free to improve it.


I am new to Kustom and criticism is appreciated.

Install widget: 36.2 KB file on MEGA

2 Likes

This is awesome! Very good job

1 Like