From 6bb49cc16cbf03d4e0980c2343372ff20d0a4b55 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sun, 17 Nov 2024 22:36:53 -0600 Subject: rename all scripts to have .user.js ext --- misc/old-reddit-page-cleanup.js | 33 ------- misc/old-reddit-page-cleanup.user.js | 33 +++++++ misc/piped-preferences.js | 43 --------- misc/piped-preferences.user.js | 43 +++++++++ .../rateyourmusic.com-dark-reader-compatibility.js | 20 ---- ...yourmusic.com-dark-reader-compatibility.user.js | 20 ++++ misc/reddit-redirect-to-old-reddit.js | 17 ---- misc/reddit-redirect-to-old-reddit.user.js | 17 ++++ misc/usps-fill-out-scheduled-pickup.js | 107 --------------------- misc/usps-fill-out-scheduled-pickup.user.js | 107 +++++++++++++++++++++ 10 files changed, 220 insertions(+), 220 deletions(-) delete mode 100644 misc/old-reddit-page-cleanup.js create mode 100644 misc/old-reddit-page-cleanup.user.js delete mode 100644 misc/piped-preferences.js create mode 100644 misc/piped-preferences.user.js delete mode 100644 misc/rateyourmusic.com-dark-reader-compatibility.js create mode 100644 misc/rateyourmusic.com-dark-reader-compatibility.user.js delete mode 100644 misc/reddit-redirect-to-old-reddit.js create mode 100644 misc/reddit-redirect-to-old-reddit.user.js delete mode 100644 misc/usps-fill-out-scheduled-pickup.js create mode 100644 misc/usps-fill-out-scheduled-pickup.user.js (limited to 'misc') diff --git a/misc/old-reddit-page-cleanup.js b/misc/old-reddit-page-cleanup.js deleted file mode 100644 index ab4007a..0000000 --- a/misc/old-reddit-page-cleanup.js +++ /dev/null @@ -1,33 +0,0 @@ -// ==UserScript== -// @name old.reddit.com page cleanup -// @namespace Violentmonkey Scripts -// @match https://old.reddit.com/* -// @grant none -// @version 1.0 -// @author tjkeller.xyz -// @description 10/20/2024, 7:22:44 PM -// ==/UserScript== - -/* remove top welcome banner */ -document.querySelector("section").remove() - -/* remove login prompt above comments */ -document.querySelector("section").remove() - -/* remove user sidebar */ -document.body.parentElement.style.paddingRight = 0 -document.getElementById("header-bottom-right").remove() - -/* remove most of the sidebar */ -const sidebar = document.querySelector("div.side") -console.log(sidebar) -sidebar.style.float = "none" -sidebar.style.margin = "25px" -while (sidebar.children[1]) - sidebar.children[1].remove() - -/* wrap code in pre instead of p */ -document.querySelectorAll("code").forEach(c => { - const pre = c.parentElement.parentElement.insertBefore(document.createElement("pre"), c.parentElement) - pre.appendChild(c) -}) diff --git a/misc/old-reddit-page-cleanup.user.js b/misc/old-reddit-page-cleanup.user.js new file mode 100644 index 0000000..ab4007a --- /dev/null +++ b/misc/old-reddit-page-cleanup.user.js @@ -0,0 +1,33 @@ +// ==UserScript== +// @name old.reddit.com page cleanup +// @namespace Violentmonkey Scripts +// @match https://old.reddit.com/* +// @grant none +// @version 1.0 +// @author tjkeller.xyz +// @description 10/20/2024, 7:22:44 PM +// ==/UserScript== + +/* remove top welcome banner */ +document.querySelector("section").remove() + +/* remove login prompt above comments */ +document.querySelector("section").remove() + +/* remove user sidebar */ +document.body.parentElement.style.paddingRight = 0 +document.getElementById("header-bottom-right").remove() + +/* remove most of the sidebar */ +const sidebar = document.querySelector("div.side") +console.log(sidebar) +sidebar.style.float = "none" +sidebar.style.margin = "25px" +while (sidebar.children[1]) + sidebar.children[1].remove() + +/* wrap code in pre instead of p */ +document.querySelectorAll("code").forEach(c => { + const pre = c.parentElement.parentElement.insertBefore(document.createElement("pre"), c.parentElement) + pre.appendChild(c) +}) diff --git a/misc/piped-preferences.js b/misc/piped-preferences.js deleted file mode 100644 index a168418..0000000 --- a/misc/piped-preferences.js +++ /dev/null @@ -1,43 +0,0 @@ -// ==UserScript== -// @name fill prefs piped -// @namespace Violentmonkey Scripts -// @match https://piped.tjkeller.xyz/* -// @grant none -// @version 1.0 -// @author tjkeller.xyz -// @description 8/16/2024, 6:10:21 PM -// ==/UserScript== - -// all skip options (if any are to be set) must be present to avoid player errors -const skipOptionsDefault = { - sponsor: "auto", - intro: "no", - outro: "no", - preview: "no", - interaction: "auto", - selfpromo: "auto", - music_offtopic: "auto", - poi_highlight: "no", - filler: "no" -} - -// fill localStorage { key: value } with preferred options -// any preferences not filled will be default -const prefs = { - bufferGoal: 30, - dearrow: true, - enabledCodecs: "avc", - homepage: "feed", - quality: 720, - showWatchOnYouTube: true, - watchHistory: true, - skipOptions: JSON.stringify({...skipOptionsDefault, ...{ - intro: "auto", - poi_highlight: "button", - filler: "button", - }}), -} - -// setup localStorage -for (const [key, value] of Object.entries(prefs)) - localStorage.setItem(key, value) diff --git a/misc/piped-preferences.user.js b/misc/piped-preferences.user.js new file mode 100644 index 0000000..a168418 --- /dev/null +++ b/misc/piped-preferences.user.js @@ -0,0 +1,43 @@ +// ==UserScript== +// @name fill prefs piped +// @namespace Violentmonkey Scripts +// @match https://piped.tjkeller.xyz/* +// @grant none +// @version 1.0 +// @author tjkeller.xyz +// @description 8/16/2024, 6:10:21 PM +// ==/UserScript== + +// all skip options (if any are to be set) must be present to avoid player errors +const skipOptionsDefault = { + sponsor: "auto", + intro: "no", + outro: "no", + preview: "no", + interaction: "auto", + selfpromo: "auto", + music_offtopic: "auto", + poi_highlight: "no", + filler: "no" +} + +// fill localStorage { key: value } with preferred options +// any preferences not filled will be default +const prefs = { + bufferGoal: 30, + dearrow: true, + enabledCodecs: "avc", + homepage: "feed", + quality: 720, + showWatchOnYouTube: true, + watchHistory: true, + skipOptions: JSON.stringify({...skipOptionsDefault, ...{ + intro: "auto", + poi_highlight: "button", + filler: "button", + }}), +} + +// setup localStorage +for (const [key, value] of Object.entries(prefs)) + localStorage.setItem(key, value) diff --git a/misc/rateyourmusic.com-dark-reader-compatibility.js b/misc/rateyourmusic.com-dark-reader-compatibility.js deleted file mode 100644 index e2c20c2..0000000 --- a/misc/rateyourmusic.com-dark-reader-compatibility.js +++ /dev/null @@ -1,20 +0,0 @@ -// ==UserScript== -// @name rateyourmusic.com darkmode compat -// @namespace Violentmonkey Scripts -// @match https://rateyourmusic.com/* -// @grant GM_addStyle -// @version 1.0 -// @author - -// @description 7/9/2024, 10:34:17 PM -// ==/UserScript== - -GM_addStyle(` - .page_charts_section_charts_item_details_average_num { background: var(--average-rating); -webkit-background-clip: text; } - .page_home_intro_content_text_sitename, - .disco_avg_rating { background-clip: text !important; } - #column_container_right *, - .disco_expand_section_btn { background: #111 !important; } - #ui_search_input_main_search { background: #252525; } - .page_home_section_featured_content_content_item .page_section_dynamic_fade_cover { background: linear-gradient(to bottom,rgba(128,128,128,0),#212121); } - .ui_button { background: 444 !important; } -`) diff --git a/misc/rateyourmusic.com-dark-reader-compatibility.user.js b/misc/rateyourmusic.com-dark-reader-compatibility.user.js new file mode 100644 index 0000000..e2c20c2 --- /dev/null +++ b/misc/rateyourmusic.com-dark-reader-compatibility.user.js @@ -0,0 +1,20 @@ +// ==UserScript== +// @name rateyourmusic.com darkmode compat +// @namespace Violentmonkey Scripts +// @match https://rateyourmusic.com/* +// @grant GM_addStyle +// @version 1.0 +// @author - +// @description 7/9/2024, 10:34:17 PM +// ==/UserScript== + +GM_addStyle(` + .page_charts_section_charts_item_details_average_num { background: var(--average-rating); -webkit-background-clip: text; } + .page_home_intro_content_text_sitename, + .disco_avg_rating { background-clip: text !important; } + #column_container_right *, + .disco_expand_section_btn { background: #111 !important; } + #ui_search_input_main_search { background: #252525; } + .page_home_section_featured_content_content_item .page_section_dynamic_fade_cover { background: linear-gradient(to bottom,rgba(128,128,128,0),#212121); } + .ui_button { background: 444 !important; } +`) diff --git a/misc/reddit-redirect-to-old-reddit.js b/misc/reddit-redirect-to-old-reddit.js deleted file mode 100644 index 3f645dc..0000000 --- a/misc/reddit-redirect-to-old-reddit.js +++ /dev/null @@ -1,17 +0,0 @@ -// ==UserScript== -// @name Redirect to old.reddit.com -// @namespace Violentmonkey Scripts -// @match http*://*.reddit.com/* -// @exclude /^https?://[a-z]{2}\.reddit\.com/* -// @exclude *out.reddit.com/* -// @exclude *://*.reddit.com/gallery/* -// @exclude *://*.reddit.com/media* -// @run-at document-start -// @grant none -// @version 1.0 -// @author tjkeller.xyz -// @description 9/11/2024, 9:40:39 AM -// ==/UserScript== - -if (!location.hostname.startsWith("old")) - location.hostname = "old.reddit.com" diff --git a/misc/reddit-redirect-to-old-reddit.user.js b/misc/reddit-redirect-to-old-reddit.user.js new file mode 100644 index 0000000..3f645dc --- /dev/null +++ b/misc/reddit-redirect-to-old-reddit.user.js @@ -0,0 +1,17 @@ +// ==UserScript== +// @name Redirect to old.reddit.com +// @namespace Violentmonkey Scripts +// @match http*://*.reddit.com/* +// @exclude /^https?://[a-z]{2}\.reddit\.com/* +// @exclude *out.reddit.com/* +// @exclude *://*.reddit.com/gallery/* +// @exclude *://*.reddit.com/media* +// @run-at document-start +// @grant none +// @version 1.0 +// @author tjkeller.xyz +// @description 9/11/2024, 9:40:39 AM +// ==/UserScript== + +if (!location.hostname.startsWith("old")) + location.hostname = "old.reddit.com" diff --git a/misc/usps-fill-out-scheduled-pickup.js b/misc/usps-fill-out-scheduled-pickup.js deleted file mode 100644 index dd4256f..0000000 --- a/misc/usps-fill-out-scheduled-pickup.js +++ /dev/null @@ -1,107 +0,0 @@ -// ==UserScript== -// @name Fill out usps scheduled pickup -// @namespace Violentmonkey Scripts -// @match https://tools.usps.com/schedule-pickup-steps.htm* -// @grant none -// @version 1.0 -// @author tjkeller.xyz -// @description 2/11/2024, 7:23:34 PM -// ==/UserScript== - -/* First page config */ -const fill = { - emailAddress: "youremail@example.com", - phoneNumber: "777-777-7777", - zipCode: "60606", - state: "IL", - city: "CHICAGO", - addressLineOne: "701 My Lovely Home St.", - lastName: "Smith", - firstName: "John" -} - -/* Misc config */ -const packageLocationFill = "Porch" - -/* Fill funcs */ -function fillInitialFields() { - for (let fieldName in fill) - document.getElementById(fieldName).value = fill[fieldName] -} - -function fillDogField() { - const f = document.querySelector("#second-radio-verification[name=isDogHere]") - f.checked = true - return f -} - -function fillPackageLocation() { - const f = document.getElementById("packageLocation") - f.value = packageLocationFill - return f -} - -function fillPickupTime() { - const f = document.getElementById("pickup-regular-time") - f.click() - return f -} - -function fillPickupDate() { - const f = document.querySelector("#schedule-pickup-cal td:not(.ui-datepicker-unselectable)") // Gets first date that is selectable - f.click() - return f -} - -function fillTerms() { - const f = document.querySelector(".termsConditions") - f.checked = true - return f -} - -function fillHazmat() { - const f = document.querySelector("#hazmat-no") - f.checked = true - return f -} - -function scrollToDetails() { - document.getElementById("quantityCheck").scrollIntoView() -} - -function showPickupDateInStepFour(pickupDateTD) { - const month = parseInt(pickupDateTD.dataset.month) + 1 - const year = pickupDateTD.dataset.year - const day = pickupDateTD.firstElementChild.innerText - - const date = `${month}-${day}-${year}` - - const dateElement = document.createElement("div") - dateElement.class = "step-four-top-header" - dateElement.innerHTML = `

` - dateElement.innerHTML += `

Date of Pickup: ${date}

` - - const container = document.querySelector("div.pickup-summary-gray-box-wrapper div") - const sibiling = container.querySelector("div.step-four-top-header") - container.insertBefore(dateElement, sibiling) - return dateElement -} - -/* Start */ -fillInitialFields() - -document.querySelector("#webToolsAddressCheck").addEventListener("click", () => { - const magicChange = new Event("change") - - fillDogField() .dispatchEvent(magicChange) - fillPackageLocation().dispatchEvent(magicChange) - - fillPickupTime() // Works through click - - setTimeout(() => { - showPickupDateInStepFour(fillPickupDate()) // Need to wait for this (calendar) to load in first since it's loaded dynamically - fillHazmat() - fillTerms() - scrollToDetails() - }, 750) -}) diff --git a/misc/usps-fill-out-scheduled-pickup.user.js b/misc/usps-fill-out-scheduled-pickup.user.js new file mode 100644 index 0000000..dd4256f --- /dev/null +++ b/misc/usps-fill-out-scheduled-pickup.user.js @@ -0,0 +1,107 @@ +// ==UserScript== +// @name Fill out usps scheduled pickup +// @namespace Violentmonkey Scripts +// @match https://tools.usps.com/schedule-pickup-steps.htm* +// @grant none +// @version 1.0 +// @author tjkeller.xyz +// @description 2/11/2024, 7:23:34 PM +// ==/UserScript== + +/* First page config */ +const fill = { + emailAddress: "youremail@example.com", + phoneNumber: "777-777-7777", + zipCode: "60606", + state: "IL", + city: "CHICAGO", + addressLineOne: "701 My Lovely Home St.", + lastName: "Smith", + firstName: "John" +} + +/* Misc config */ +const packageLocationFill = "Porch" + +/* Fill funcs */ +function fillInitialFields() { + for (let fieldName in fill) + document.getElementById(fieldName).value = fill[fieldName] +} + +function fillDogField() { + const f = document.querySelector("#second-radio-verification[name=isDogHere]") + f.checked = true + return f +} + +function fillPackageLocation() { + const f = document.getElementById("packageLocation") + f.value = packageLocationFill + return f +} + +function fillPickupTime() { + const f = document.getElementById("pickup-regular-time") + f.click() + return f +} + +function fillPickupDate() { + const f = document.querySelector("#schedule-pickup-cal td:not(.ui-datepicker-unselectable)") // Gets first date that is selectable + f.click() + return f +} + +function fillTerms() { + const f = document.querySelector(".termsConditions") + f.checked = true + return f +} + +function fillHazmat() { + const f = document.querySelector("#hazmat-no") + f.checked = true + return f +} + +function scrollToDetails() { + document.getElementById("quantityCheck").scrollIntoView() +} + +function showPickupDateInStepFour(pickupDateTD) { + const month = parseInt(pickupDateTD.dataset.month) + 1 + const year = pickupDateTD.dataset.year + const day = pickupDateTD.firstElementChild.innerText + + const date = `${month}-${day}-${year}` + + const dateElement = document.createElement("div") + dateElement.class = "step-four-top-header" + dateElement.innerHTML = `

` + dateElement.innerHTML += `

Date of Pickup: ${date}

` + + const container = document.querySelector("div.pickup-summary-gray-box-wrapper div") + const sibiling = container.querySelector("div.step-four-top-header") + container.insertBefore(dateElement, sibiling) + return dateElement +} + +/* Start */ +fillInitialFields() + +document.querySelector("#webToolsAddressCheck").addEventListener("click", () => { + const magicChange = new Event("change") + + fillDogField() .dispatchEvent(magicChange) + fillPackageLocation().dispatchEvent(magicChange) + + fillPickupTime() // Works through click + + setTimeout(() => { + showPickupDateInStepFour(fillPickupDate()) // Need to wait for this (calendar) to load in first since it's loaded dynamically + fillHazmat() + fillTerms() + scrollToDetails() + }, 750) +}) -- cgit v1.2.3