您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Check won giveaways the fast & convenient way
// ==UserScript== // @name IndieGala: Check giveaways if won // @version 1.1.0 // @description Check won giveaways the fast & convenient way // @author Hafas (https://github.com/Hafas/) // @match https://www.indiegala.com/profile* // @grant none // @namespace https://gf.qytechs.cn/users/56087 // ==/UserScript== (function () { var $completedTab = $(".giveaway-completed").parent(); $completedTab.prepend("<button/>"); var $myButton = $("button", $completedTab).first(); activateButton(); $myButton.on("click", function () { deactivateButton(); checkAllIfWon().then(function (html) { printSummary(html); activateButton(); }); }); function activateButton () { $myButton.html("Check all if won"); $myButton.css({ background: "#CC001D", color: "white", float: "right", marginLeft: "2px", padding: "9px" }); $myButton.attr("disabled", false); } function deactivateButton () { $myButton.html("Checking ..."); $myButton.css({background: "#999"}); $myButton.attr("disabled", true); } function getCompleted () { return $.ajax({ url: "/giveaways/library_completed", dataType: "json" }).then(null, function (error) { //retry in 10s return delay(getCompleted, 10000); }); } function checkAllIfWon (entryIds) { return $.ajax({ url: "/giveaways/check_if_won_all" }).then(null, function () { //retry in 10s return delay(checkAllIfWon, 10000); }); } function printSummary (html) { alert($(html).text().trim()); } function delay (fn, timeout) { return $.Deferred(function (d) { setTimeout(function () { fn().then(function (value) { d.resolve(value); }); }, timeout); }); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址