Skip to content

Instantly share code, notes, and snippets.

@davemackintosh
Created January 18, 2018 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davemackintosh/f126f24db02243fa4a19c3f889a19fe7 to your computer and use it in GitHub Desktop.
Save davemackintosh/f126f24db02243fa4a19c3f889a19fe7 to your computer and use it in GitHub Desktop.
Run in a console on the track package page of an Amazon order and you'll get a new localStorage entry each time it's run to track progress through the day.
(function getProgress() {
if (!localStorage.amazonProgress)
localStorage.amazonProgress = "[]"
const store = JSON.parse(localStorage.amazonProgress)
store.push({
time: Date.now(),
progress: JSON.parse(document.querySelector("script[type=\"a-state\"]").innerText).progressTracker.lastTransitionPercentComplete
})
localStorage.amazonProgress = JSON.stringify(store)
return store
})()
@Andy-set-studio
Copy link

If we can work out a pattern, we could return a status of sorts:

switch(progress) {
    case 90:
        status = 'You\'re package should be arriving soon';
        break;
}

Something like that anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment