Skip to content

Instantly share code, notes, and snippets.

@Karmalakas
Last active June 20, 2024 21:46
Show Gist options
  • Save Karmalakas/dd3e9d1744a67dd6fd2272c652bbea66 to your computer and use it in GitHub Desktop.
Save Karmalakas/dd3e9d1744a67dd6fd2272c652bbea66 to your computer and use it in GitHub Desktop.
Mark challenge when boost is available
// ==UserScript==
// @name GuruShots boost notifier
// @description Mark challenge when boost is available
// @namespace http://karmalakas.lt/
// @version 1.1.0
// @author Karmalakas
// @updateURL https://gist.github.com/Karmalakas/dd3e9d1744a67dd6fd2272c652bbea66/raw/GS_Boost_Notifier.user.js
// @downloadURL https://gist.github.com/Karmalakas/dd3e9d1744a67dd6fd2272c652bbea66/raw/GS_Boost_Notifier.user.js
// @supportURL https://gist.github.com/Karmalakas/dd3e9d1744a67dd6fd2272c652bbea66
// @match https://gurushots.com/*
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
var mutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
function process() {
var buttons = document.querySelectorAll(
'app-active-challenge-action-button-component .blink[class^="boost"],app-active-challenge-action-button-component .blink[class*=" boost"]'
);
if (!buttons.length) {
return;
}
for (var i = 0; i < buttons.length; i++) {
processButton(buttons[i]);
}
}
function processButton(button) {
var challengeHolder = button.closest('challenges-item').style['boxShadow'] = '0 0 0 7px rgba(151,255,151,0.75)';
}
if (mutationObserver) {
var body = document.querySelector('body');
if (!body) {
return;
}
(new mutationObserver(process)).observe(body, {
'childList': true,
'subtree': true
});
}
})();
@Karmalakas
Copy link
Author

Karmalakas commented Jan 7, 2021

This script might help you notice when the boost is available for challenge.
What this script does, is just find all active Boost buttons and add a green(ish) border around the challenge block.

See image bellow.


This only works with TamperMonkey (or similar) extension. Supported browsers are Chrome, Firefox, Edge (maybe others too).

TamperMonkey for:

Once you have TamperMonkey installed, just go to the @downloadURL you see in a script.
If later TM fails to update script, just go to @updateURL you see in a script. This should trigger the update in a new window with TM open.

Any questions or suggestions are welcome.


If you like this script, please consider keeping me scripting Keep me scripting πŸ˜„

@Karmalakas
Copy link
Author

Screenshot 2021-01-07 203216

If you wonder where this real challenge end time is from, you should check out this script too (there are also more screenshots in the comments).

@Samoiedo77
Copy link

Hi, great script! It has been useful till yesterday! Unfortunately GS changed the page layout so now the script is not working... Is there any chance you will update the script? Thanks a lot man!

@Karmalakas
Copy link
Author

Will do πŸ™‚ Just need to get the boost myself and be available to code at that time πŸ˜…

Thanks for letting me know πŸ™

@Karmalakas
Copy link
Author

@Samoiedo77, script updated to v1.1.0 πŸ˜‰

@Samoiedo77
Copy link

Samoiedo77 commented Jun 5, 2024

Thanks man! It works like a charm! πŸ™πŸΌ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment