aboutsummaryrefslogtreecommitdiff
path: root/usps/fill-out-usps-scheduled-pickup.js
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2024-08-10 19:52:03 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2024-08-10 19:52:03 -0500
commit8e793e9d239ae9008382e0af07a163eae804ee32 (patch)
treea8b4e47d6667793a5c8a158339f6512c95460cf0 /usps/fill-out-usps-scheduled-pickup.js
parent5cd7617d4467693feced81b440eee8782aebdb02 (diff)
downloaduserscripts-8e793e9d239ae9008382e0af07a163eae804ee32.tar.xz
userscripts-8e793e9d239ae9008382e0af07a163eae804ee32.zip
move usps and rateyourmusic dark reader script
Diffstat (limited to 'usps/fill-out-usps-scheduled-pickup.js')
-rw-r--r--usps/fill-out-usps-scheduled-pickup.js107
1 files changed, 0 insertions, 107 deletions
diff --git a/usps/fill-out-usps-scheduled-pickup.js b/usps/fill-out-usps-scheduled-pickup.js
deleted file mode 100644
index 88660fc..0000000
--- a/usps/fill-out-usps-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 -
-// @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 = `<p class="step-four-row-header"></p>`
- dateElement.innerHTML += `<p class="step-four-row-header" style="font-weight:bold;">Date of Pickup: ${date}</p>`
-
- 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)
-})