init of v2 of the awesome monkey repo
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
# My-monkey-scripts
|
||||||
|
Scripts that make the internet useable
|
||||||
|
|
||||||
|
(mainly youtube and ebay)
|
||||||
|
|
||||||
|
scripts descriptions
|
||||||
|
|
||||||
|
## ebay pricer
|
||||||
|
adds the total of the shipping and price you pay if shipping exists.
|
||||||
|
|
||||||
|
## no numpad youtube
|
||||||
|
removes the numpad for switching to points in a video (useful for laptops)
|
||||||
|
|
||||||
|
## redirect to reddit
|
||||||
|
man because FUCK REDDIT I HATE WHEN I VIISIT A FUCKING REDDIT LINK AND I SEE "You've been blocked by network security." FUCK YOU.
|
||||||
|
|
||||||
|
Anyways its for redirecting reddit links to redlib (not forcefully)
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name ebay pricer
|
||||||
|
// @version 1.0
|
||||||
|
// @author Stabosa87
|
||||||
|
// @match https://www.ebay.com/*
|
||||||
|
// @grant none
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
function money(text) {
|
||||||
|
let m = text.match(/\$([\d.]+)/);
|
||||||
|
return m ? parseFloat(m[1]) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
document.querySelectorAll("li.s-card").forEach(card => {
|
||||||
|
|
||||||
|
if (card.dataset.priced) return;
|
||||||
|
|
||||||
|
let pricel = card.querySelector(".s-card__price");
|
||||||
|
if (!pricel) return;
|
||||||
|
|
||||||
|
let price = money(pricel.textContent);
|
||||||
|
let shipping = 0;
|
||||||
|
|
||||||
|
card.querySelectorAll(".s-card__attribute-row").forEach(row => {
|
||||||
|
if (row.textContent.includes("delivery") && row.textContent.includes("+$")) {
|
||||||
|
shipping = money(row.textContent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (shipping > 0) {
|
||||||
|
pricel.innerHTML += ` <span style="font-size:.85em;color:#666;">(or $${(price + shipping).toFixed(2)} total)</span>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
card.dataset.priced = 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
update();
|
||||||
|
|
||||||
|
new MutationObserver(update).observe(document.body, {
|
||||||
|
childList: true,
|
||||||
|
subtree: true
|
||||||
|
});
|
||||||
|
})();
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name No youtube numpad
|
||||||
|
// @version 1.0
|
||||||
|
// @match https://www.youtube.com/*
|
||||||
|
// @author Stabosa87
|
||||||
|
// @grant none
|
||||||
|
// @run-at document-start
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const keyset = new Set([
|
||||||
|
'Digit0','Digit1','Digit2','Digit3','Digit4',
|
||||||
|
'Digit5','Digit6','Digit7','Digit8','Digit9',
|
||||||
|
'Numpad0','Numpad1','Numpad2','Numpad3','Numpad4',
|
||||||
|
'Numpad5','Numpad6','Numpad7','Numpad8','Numpad9'
|
||||||
|
]);
|
||||||
|
|
||||||
|
function typing(el) {
|
||||||
|
if (!el) return false;
|
||||||
|
|
||||||
|
const tag = el.tagName;
|
||||||
|
return (
|
||||||
|
tag === 'INPUT' ||
|
||||||
|
tag === 'TEXTAREA' ||
|
||||||
|
el.isContentEditable
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handler(e) {
|
||||||
|
if (!keyset.has(e.code)) return;
|
||||||
|
if (typing(document.activeElement)) return;
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('keydown', handler, true);
|
||||||
|
})();
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name Redtolib
|
||||||
|
// @version 1.0
|
||||||
|
// @match https://*.reddit.com/*
|
||||||
|
// @match https://reddit.com/*
|
||||||
|
// @author Stabosa87
|
||||||
|
// @grant none
|
||||||
|
// @run-at document-end
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.innerText = 'VIEW ON REDLIB';
|
||||||
|
|
||||||
|
link.style.position = 'fixed';
|
||||||
|
link.style.top = '0';
|
||||||
|
link.style.left = '0';
|
||||||
|
link.style.zIndex = '6969696969';
|
||||||
|
link.style.display = 'none';
|
||||||
|
|
||||||
|
fetch("https://raw.githubusercontent.com/redlib-org/redlib-instances/main/instances.json")
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
if (data && data.instances && data.instances.length > 0) {
|
||||||
|
const Redliburl = data.instances[0].url;
|
||||||
|
const path = window.location.pathname + window.location.search + window.location.hash;
|
||||||
|
link.href = Redliburl + path;
|
||||||
|
link.style.display = 'inline';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => console.error(e));
|
||||||
|
|
||||||
|
document.body.appendChild(link);
|
||||||
|
})();
|
||||||
Reference in New Issue
Block a user