From 8e793e9d239ae9008382e0af07a163eae804ee32 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 10 Aug 2024 19:52:03 -0500 Subject: move usps and rateyourmusic dark reader script --- .../rateyourmusic.com-dark-reader-compatibility.js | 20 ++++ misc/usps-fill-out-scheduled-pickup.js | 107 +++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 misc/rateyourmusic.com-dark-reader-compatibility.js create mode 100644 misc/usps-fill-out-scheduled-pickup.js (limited to 'misc') diff --git a/misc/rateyourmusic.com-dark-reader-compatibility.js b/misc/rateyourmusic.com-dark-reader-compatibility.js new file mode 100644 index 0000000..587fd7d --- /dev/null +++ b/misc/rateyourmusic.com-dark-reader-compatibility.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/usps-fill-out-scheduled-pickup.js b/misc/usps-fill-out-scheduled-pickup.js new file mode 100644 index 0000000..a8359ce --- /dev/null +++ b/misc/usps-fill-out-scheduled-pickup.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