Skip to content

Instantly share code, notes, and snippets.

@jnobile
Created January 30, 2017 05:42
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 jnobile/1ccceb837d5df9af92a6937adde49713 to your computer and use it in GitHub Desktop.
Save jnobile/1ccceb837d5df9af92a6937adde49713 to your computer and use it in GitHub Desktop.
var productIds = [];
$("div.search-result")
.filter(function() {
return $(this).find("div.sale-price span.money").text() == '$0.00' && $(this).find("button.orange").text() == 'Add to cart';
})
.each(function() {
productIds.push($(this).find("button[title='Add to cart']").parent().attr('action').replace('/buy/', ''));
});
var buyAllUrl = 'https://www.logos.com/buy/' + productIds.join();
console.log(buyAllUrl);
window.open(buyAllUrl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment