nathan

joined 7 months ago
[–] nathan@piefed.alphapuggle.dev 57 points 5 months ago

Well, not with that attitude!

[–] nathan@piefed.alphapuggle.dev 3 points 5 months ago

I wrote this one ages ago to throw shopgoodwill.com items in my calendar because the times are in PDT and they don't have any built in notification (that works)

Also made it work with govdeals but I haven't tested that in ages so YMMV

Writes it to a Google calendar URL. I had it write to an ICS file at one point but I don't have version control on this one file

javascript: (
    () => {
        function createItem(productTitle, date) {
            console.log(productTitle, date);
             window.open(`https://calendar.google.com/calendar/render?action=TEMPLATE&text=%24%7BproductTitle%7D&details=%24%7BproductTitle%7D @ Goodwill ${window.location}&dates=${date}/${date}`);
        }
        if (window.location.href.toString().includes("https://shopgoodwill.com/item/")) {
            try {
                let title = document.querySelectorAll(".mb-4.d-none.d-md-block.ng-star-inserted")[0].innerText;
                let headers = document.querySelectorAll("th.font-weight-bold.text-nowrap");
                let time;
                if (headers[4].innerHTML == " Handling Price: ") {
                    time = headers[5] }
                else {
                    time = headers[4]
                }
                time = time.parentElement.children[1].innerHTML.substring(0, 25) + "DT";
                console.log(headers);
                createItem(title, new Date(time).toISOString().split(".")[0].replace(/-/gi, "").replace(/:/gi, "") + "Z");
            } catch (e) {
                alert("An error occurred, check the console for full details: " + e);
                console.log(e); 
            }
        } else if (window.location.href.toString().includes("https://www.govdeals.com/index.cfm")) {
            try {
                createItem(document.querySelectorAll("#asset_short_desc_id")[0].innerText, new Date(document.querySelectorAll("tr > td[align='right'][nowrap='nowrap'] > b")[0].innerText.replace("ET", "EDT")).toISOString().split(".")[0].replace(/-/gi, "").replace(/:/gi, "") + "Z");
            } catch (e) {
                alert("An error occurred, check the console for full details: " + e);
                console.log(e);
            }
        } else {
            alert("This is not a goodwill or govdeals item page.");
        }
    })();
[–] nathan@piefed.alphapuggle.dev 112 points 5 months ago (7 children)

This isn't YAML, this is just sparkling JSON

[–] nathan@piefed.alphapuggle.dev 11 points 5 months ago

I've tried and it's returned to my bank account just fine. Their purchase disputes are pretty easy too

[–] nathan@piefed.alphapuggle.dev 32 points 5 months ago (2 children)

Back in my day we crafted racist videos by hand

[–] nathan@piefed.alphapuggle.dev 2 points 6 months ago (1 children)

What blinds are these? I've never seen this type before

[–] nathan@piefed.alphapuggle.dev 2 points 6 months ago* (last edited 6 months ago)

Apologies for the YouTube link, but it's the only source I can find referencing it at the moment

https://youtu.be/MVXMcrRANC8
https://archive.org/details/kdewin4

[–] nathan@piefed.alphapuggle.dev 3 points 6 months ago

Stupid, but I'd just lap it. Would give me the difference and worked well enough for the rare occasion I actually needed a stopwatch.

Also the Google sign in trick only works if you're signed into Google. I used to put lineage on my old phones and now GrapheneOS. I stopped doing the stopwatch thing long ago however.

[–] nathan@piefed.alphapuggle.dev 14 points 6 months ago

I could use my phone like normal. It marks the start time then anytime you view it it'll display the difference. Reboots had no effect

[–] nathan@piefed.alphapuggle.dev 7 points 6 months ago (5 children)

I used to start a stopwatch when I'd get a new phone so I could see exactly how long I had it. Can't say I ever tried to move them to a new device though

view more: ‹ prev next ›