Created
April 12, 2013 14:50
-
-
Save UltraNurd/5372576 to your computer and use it in GitHub Desktop.
This JavaScript one-liner iterates through all of the paging and "add to cart" buttons at promo.comixology.com to add each of 723 Marvel #1s to your Comixology cart. Checkout and login etc. are still handled manually. I just pasted this into my Chrome console.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pagers = document.getElementsByClassName('adHocPager'); | |
for (i = 0; i < 18; i++) { | |
add_buttons = document.getElementsByClassName('addComicLink'); | |
for (a = 0; a < add_buttons.length; a++) { | |
if (add_buttons[a].text != 'In Cart') { | |
add_buttons[a].click(); | |
} | |
} | |
for (p = 0; p < pagers.length; p++) { | |
next_buttons = pagers[p].getElementsByTagName('a'); | |
next_button = next_buttons[next_buttons.length - 1]; | |
next_button.click(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment