2 releases
0.1.41 | Aug 4, 2024 |
---|---|
0.1.4 | Aug 4, 2024 |
#4 in #user-profile
12KB
244 lines
duolingo-query
A teeny tiny rust library to query duolingo users' profile information through the unofficial Duolingo API
Example
// Query information about a duolingo user
let duo = Duolingo::query("christi3").await?;
// Print information about user's streaks
println!("{}", "-".repeat(10));
println!("Streak: {}", duo.get_streak());
println!("Uid: {}", duo.get_id());
// Dates are unix timestamps
println!("Creation date: {}", duo.get_creation_date());
// Print information about the user's courses
duo.get_courses().iter().for_each(|course| {
println!("{}", "-".repeat(10));
println!("Course: {}", course.get_title());
println!("Course XP: {}", course.get_xp());
println!("Course Lang: {}", course.get_learning_language());
});
println!("{}", "-".repeat(10));
println!("Total XP: {}", duo.get_total_xp());
println!("Username: {}", duo.get_username());
println!("Learning language: {}", duo.get_learning_language());
println!("Has Duolingo Plus: {}", duo.has_plus());
println!("{}", "-".repeat(10));
API Warning
⚠️ This library is sensitive to api changes and as such might break if duolingo updates their api
Please don't hesitate to create an issue if the duolingo api changes
Dependencies
~6–17MB
~224K SLoC