gistfile1.txt
· 1.6 KiB · Text
Brut
// ==UserScript==
// @name Auto Open Tab
// @namespace http://tampermonkey.net/
// @version 2026-04-08
// @description try to take over the world!
// @author You
// @match https://dyandraglobalstore-02.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=dyandraglobalstore-02.com
// @grant GM_openInTab
// ==/UserScript==
(function() {
'use strict';
const TARGET_HOUR = 15; // 5 PM
const TARGET_MINUTE = 0; // 00 minutes
const URL_PATTERN = /^https:\/\/widget\.loket\.com(\/.*)?$/;
const now = new Date();
const currentHour = now.getHours();
const currentMinute = now.getMinutes();
// Check if current time is past the target time
if (currentHour > TARGET_HOUR ||
(currentHour === TARGET_HOUR && currentMinute >= TARGET_MINUTE)) {
// Get all links on the page
const allLinks = document.querySelectorAll('a[href]');
// Filter and get unique matching URLs
const matchingUrls = new Set();
allLinks.forEach(link => {
const href = link.href;
if (URL_PATTERN.test(href)) {
matchingUrls.add(href);
}
});
if (matchingUrls.size > 0) {
let index = 1;
matchingUrls.forEach(url => {
console.log(` ${index++}. ${url}`);
});
// Open all matching URLs in new tabs
matchingUrls.forEach(url => {
console.log(🚀 Opening: ${url});
window.open(url, '_blank');
});
} else {
}
} else {
}
})();
| 1 | // ==UserScript== |
| 2 | // @name Auto Open Tab |
| 3 | // @namespace http://tampermonkey.net/ |
| 4 | // @version 2026-04-08 |
| 5 | // @description try to take over the world! |
| 6 | // @author You |
| 7 | // @match https://dyandraglobalstore-02.com/* |
| 8 | // @icon https://www.google.com/s2/favicons?sz=64&domain=dyandraglobalstore-02.com |
| 9 | // @grant GM_openInTab |
| 10 | // ==/UserScript== |
| 11 | |
| 12 | |
| 13 | (function() { |
| 14 | 'use strict'; |
| 15 | |
| 16 | const TARGET_HOUR = 15; // 5 PM |
| 17 | const TARGET_MINUTE = 0; // 00 minutes |
| 18 | |
| 19 | const URL_PATTERN = /^https:\/\/widget\.loket\.com(\/.*)?$/; |
| 20 | |
| 21 | const now = new Date(); |
| 22 | const currentHour = now.getHours(); |
| 23 | const currentMinute = now.getMinutes(); |
| 24 | |
| 25 | |
| 26 | // Check if current time is past the target time |
| 27 | if (currentHour > TARGET_HOUR || |
| 28 | (currentHour === TARGET_HOUR && currentMinute >= TARGET_MINUTE)) { |
| 29 | |
| 30 | |
| 31 | // Get all links on the page |
| 32 | const allLinks = document.querySelectorAll('a[href]'); |
| 33 | |
| 34 | // Filter and get unique matching URLs |
| 35 | const matchingUrls = new Set(); |
| 36 | |
| 37 | allLinks.forEach(link => { |
| 38 | const href = link.href; |
| 39 | if (URL_PATTERN.test(href)) { |
| 40 | matchingUrls.add(href); |
| 41 | } |
| 42 | }); |
| 43 | |
| 44 | |
| 45 | if (matchingUrls.size > 0) { |
| 46 | let index = 1; |
| 47 | matchingUrls.forEach(url => { |
| 48 | console.log(` ${index++}. ${url}`); |
| 49 | }); |
| 50 | |
| 51 | // Open all matching URLs in new tabs |
| 52 | matchingUrls.forEach(url => { |
| 53 | console.log(🚀 Opening: ${url}); |
| 54 | window.open(url, '_blank'); |
| 55 | }); |
| 56 | } else { |
| 57 | } |
| 58 | |
| 59 | } else { |
| 60 | } |
| 61 | |
| 62 | })(); |