Last active 1 week ago

gistfile1.txt Raw
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})();