Duolingo Streak Saver

Tự động duy trì streak hàng ngày trên Duolingo

// ==UserScript==
// @name         Duolingo Streak Saver
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Tự động duy trì streak hàng ngày trên Duolingo
// @author       Bạn
// @match        https://www.duolingo.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const saveStreak = async () => {
        const response = await fetch('https://www.duolingo.com/2017-06-30/users/{user_id}/xp', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${localStorage.getItem('jwt')}`
            },
            body: JSON.stringify({
                'xpGained': 10,
                'learningLanguage': 'en'
            })
        });

        if (response.ok) {
            console.log('Streak saved successfully!');
        } else {
            console.error('Failed to save streak.');
        }
    };

    const runStreakSaver = () => {
        if (window.location.href.includes('duolingo.com')) {
            saveStreak();
        }
    };

    setInterval(runStreakSaver, 3600000); // Tự động gọi mỗi giờ
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址